Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/winex11.drv/window.c | 29 +++++++++++++++++++++++++++++ dlls/winex11.drv/x11drv.h | 8 +------- 2 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 4e01eb201c..0fc3ce9246 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -275,6 +275,35 @@ static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD styl return is_window_rect_fullscreen( &data->whole_rect ); }
+struct fullscreen_info +{ + const RECT *rect; + BOOL fullscreen; +}; + +static BOOL CALLBACK enum_monitor_proc( HMONITOR monitor, HDC hdc, RECT *rect, LPARAM lparam ) +{ + struct fullscreen_info *fullscreen_info = (struct fullscreen_info *)lparam; + + if (fullscreen_info->rect->left <= rect->left && + fullscreen_info->rect->right >= rect->right && + fullscreen_info->rect->top <= rect->top && + fullscreen_info->rect->bottom >= rect->bottom) + { + fullscreen_info->fullscreen = TRUE; + return FALSE; + } + + return TRUE; +} + +BOOL is_window_rect_fullscreen( const RECT *rect ) +{ + struct fullscreen_info info = {rect, FALSE}; + + EnumDisplayMonitors( NULL, NULL, enum_monitor_proc, (LPARAM)&info ); + return info.fullscreen; +}
/*********************************************************************** * get_mwm_decorations diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index e71156cbb0..da08c6f62c 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -637,6 +637,7 @@ typedef int (*x11drv_error_callback)( Display *display, XErrorEvent *event, void extern void X11DRV_expect_error( Display *display, x11drv_error_callback callback, void *arg ) DECLSPEC_HIDDEN; extern int X11DRV_check_error(void) DECLSPEC_HIDDEN; extern void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect, int x, int y, int cx, int cy ) DECLSPEC_HIDDEN; +extern BOOL is_window_rect_fullscreen( const RECT *rect ) DECLSPEC_HIDDEN; extern POINT virtual_screen_to_root( INT x, INT y ) DECLSPEC_HIDDEN; extern POINT root_to_virtual_screen( INT x, INT y ) DECLSPEC_HIDDEN; extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN; @@ -764,11 +765,4 @@ static inline BOOL is_window_rect_mapped( const RECT *rect ) max( rect->bottom, rect->top + 1 ) > virtual_rect.top); }
-static inline BOOL is_window_rect_fullscreen( const RECT *rect ) -{ - RECT primary_rect = get_primary_monitor_rect(); - return (rect->left <= primary_rect.left && rect->right >= primary_rect.right && - rect->top <= primary_rect.top && rect->bottom >= primary_rect.bottom); -} - #endif /* __WINE_X11DRV_H */