From: Gabriel Ivăncescu gabrielopcode@gmail.com
It's simpler to just use the same sequence as normal fullscreen windows and avoid headaches with virtual desktops.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56149 Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/winex11.drv/desktop.c | 24 ++++++++++++------------ dlls/winex11.drv/window.c | 6 +++++- dlls/winex11.drv/x11drv.h | 1 + 3 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 5867f9d16a4..1d888b7ed0b 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -99,12 +99,20 @@ BOOL is_desktop_fullscreen(void) primary_rect.bottom - primary_rect.top == host_primary_rect.bottom - host_primary_rect.top); }
-static void update_desktop_fullscreen( unsigned int width, unsigned int height) +void update_desktop_fullscreen( struct x11drv_win_data *data ) { - Display *display = thread_display(); + Display *display = data->display; + RECT primary_rect; + INT width, height; XEvent xev;
- if (!display || !is_virtual_desktop()) return; + if (!is_virtual_desktop()) return; + + primary_rect = NtUserGetPrimaryMonitorRect(); + width = primary_rect.right; + height = primary_rect.bottom; + + TRACE( "desktop %p change to (%dx%d)\n", data->hwnd, width, height );
xev.xclient.type = ClientMessage; xev.xclient.window = root_window; @@ -139,20 +147,12 @@ void X11DRV_resize_desktop(void) { static RECT old_virtual_rect;
- RECT primary_rect, virtual_rect; + RECT virtual_rect = NtUserGetVirtualScreenRect(); HWND hwnd = NtUserGetDesktopWindow(); - INT width, height; - - virtual_rect = NtUserGetVirtualScreenRect(); - primary_rect = NtUserGetPrimaryMonitorRect(); - width = primary_rect.right; - height = primary_rect.bottom;
- TRACE( "desktop %p change to (%dx%d)\n", hwnd, width, height ); NtUserSetWindowPos( hwnd, 0, virtual_rect.left, virtual_rect.top, virtual_rect.right - virtual_rect.left, virtual_rect.bottom - virtual_rect.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE ); - update_desktop_fullscreen( width, height );
if (old_virtual_rect.left != virtual_rect.left || old_virtual_rect.top != virtual_rect.top) send_message_timeout( HWND_BROADCAST, WM_X11DRV_DESKTOP_RESIZED, old_virtual_rect.left, diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index f5f2dd03662..dba5be4c459 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1041,7 +1041,11 @@ void update_net_wm_states( struct x11drv_win_data *data ) UINT i, style, ex_style, new_state = 0;
if (!data->managed) return; - if (data->whole_window == root_window) return; + if (data->whole_window == root_window) + { + update_desktop_fullscreen(data); + return; + }
style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); if (style & WS_MINIMIZE) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index c80e4b3d3c9..08ede6682a4 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -763,6 +763,7 @@ extern void X11DRV_resize_desktop(void); extern BOOL is_virtual_desktop(void); extern BOOL is_desktop_fullscreen(void); extern BOOL is_detached_mode(const DEVMODEW *); +void update_desktop_fullscreen(struct x11drv_win_data*); void X11DRV_Settings_Init(void);
void X11DRV_XF86VM_Init(void);