winex11: Don't give focus to zero-size windows.

This commit is contained in:
Alexandre Julliard 2012-02-01 15:33:51 +01:00
parent a1580bba70
commit 002f85a275
1 changed files with 3 additions and 0 deletions

View File

@ -520,12 +520,15 @@ DWORD EVENT_x11_time_to_win32_time(Time time)
*/
static inline BOOL can_activate_window( HWND hwnd )
{
struct x11drv_win_data *data = X11DRV_get_win_data( hwnd );
LONG style = GetWindowLongW( hwnd, GWL_STYLE );
if (!(style & WS_VISIBLE)) return FALSE;
if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
if (style & WS_MINIMIZE) return FALSE;
if (GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_NOACTIVATE) return FALSE;
if (hwnd == GetDesktopWindow()) return FALSE;
if (data && IsRectEmpty( &data->window_rect )) return FALSE;
return !(style & WS_DISABLED);
}