diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index d78449c2cc7..eb5e6a6c0d4 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -548,7 +548,8 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) { struct x11drv_win_data *data; struct x11drv_thread_data *thread_data; - RECT rect; + MONITORINFO monitor_info; + HMONITOR monitor; DWORD style; BOOL fullscreen; @@ -559,21 +560,25 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) /* maximized windows don't count as full screen */ if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) return FALSE; if (!(data = get_win_data( hwnd ))) return FALSE; - fullscreen = is_window_rect_fullscreen( &data->whole_rect ); + fullscreen = is_window_rect_full_screen( &data->whole_rect ); release_win_data( data ); if (!fullscreen) return FALSE; if (!(thread_data = x11drv_thread_data())) return FALSE; if (GetTickCount() - thread_data->clip_reset < 1000) return FALSE; if (!reset && clipping_cursor && thread_data->clip_hwnd) return FALSE; /* already clipping */ - rect = get_primary_monitor_rect(); + + monitor = MonitorFromWindow( hwnd, MONITOR_DEFAULTTONEAREST ); + if (!monitor) return FALSE; + monitor_info.cbSize = sizeof(monitor_info); + if (!GetMonitorInfoW( monitor, &monitor_info )) return FALSE; if (!grab_fullscreen) { RECT virtual_rect = get_virtual_screen_rect(); - if (!EqualRect( &rect, &virtual_rect )) return FALSE; + if (!EqualRect( &monitor_info.rcMonitor, &virtual_rect )) return FALSE; if (is_virtual_desktop()) return FALSE; } TRACE( "win %p clipping fullscreen\n", hwnd ); - return grab_clipping_window( &rect ); + return grab_clipping_window( &monitor_info.rcMonitor ); } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 6378c9c7650..455957264bc 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2460,7 +2460,7 @@ void CDECL X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags { release_win_data( data ); unmap_window( hwnd ); - if (is_window_rect_fullscreen( &old_window_rect )) reset_clipping_window(); + if (is_window_rect_full_screen( &old_window_rect )) reset_clipping_window(); if (!(data = get_win_data( hwnd ))) return; } } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index ce00e6c54dd..a92c738a685 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -822,11 +822,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 */