diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 32a3f4c3fd5..9e676123a06 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -224,24 +224,6 @@ static BOOL is_window_managed( HWND hwnd, UINT swp_flags, const RECT *window_rec } -/*********************************************************************** - * is_window_rect_mapped - * - * Check if the X whole window should be mapped based on its rectangle - */ -static BOOL is_window_rect_mapped( const RECT *rect ) -{ - /* don't map if rect is off-screen */ - if (rect->left >= virtual_screen_rect.right || - rect->top >= virtual_screen_rect.bottom || - rect->right <= virtual_screen_rect.left || - rect->bottom <= virtual_screen_rect.top) - return FALSE; - - return TRUE; -} - - /*********************************************************************** * is_window_resizable * @@ -251,8 +233,7 @@ static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD styl { if (style & WS_THICKFRAME) return TRUE; /* Metacity needs the window to be resizable to make it fullscreen */ - return (data->whole_rect.left <= 0 && data->whole_rect.right >= screen_width && - data->whole_rect.top <= 0 && data->whole_rect.bottom >= screen_height); + return is_window_rect_fullscreen( &data->whole_rect ); } @@ -1271,8 +1252,7 @@ void update_net_wm_states( Display *display, struct x11drv_win_data *data ) if (data->whole_window == root_window) return; style = GetWindowLongW( data->hwnd, GWL_STYLE ); - if (data->whole_rect.left <= 0 && data->whole_rect.right >= screen_width && - data->whole_rect.top <= 0 && data->whole_rect.bottom >= screen_height) + if (is_window_rect_fullscreen( &data->whole_rect )) { if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) new_state |= (1 << NET_WM_STATE_MAXIMIZED); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index a924e06a6ed..8e756b2d709 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -819,6 +819,18 @@ static inline void mirror_rect( const RECT *window_rect, RECT *rect ) rect->right = width - tmp; } +static inline BOOL is_window_rect_mapped( const RECT *rect ) +{ + return (rect->left < virtual_screen_rect.right && rect->top < virtual_screen_rect.bottom && + rect->right > virtual_screen_rect.left && rect->bottom > virtual_screen_rect.top); +} + +static inline BOOL is_window_rect_fullscreen( const RECT *rect ) +{ + return (rect->left <= 0 && rect->right >= screen_width && + rect->top <= 0 && rect->bottom >= screen_height); +} + /* X context to associate a hwnd to an X window */ extern XContext winContext;