Instead of NtUserGetPrimaryMonitorRect which may not be up to date depening on the prefix startup sequence.
From: Rémi Bernon rbernon@codeweavers.com
Instead of NtUserGetPrimaryMonitorRect which may not be up to date depening on the prefix startup sequence. --- dlls/winex11.drv/desktop.c | 18 ++++++++---------- dlls/winex11.drv/window.c | 4 ++-- dlls/winex11.drv/x11drv.h | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 7870e7b3145..250190e7af7 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -95,14 +95,14 @@ BOOL X11DRV_CreateDesktop( const WCHAR *name, UINT width, UINT height ) return TRUE; }
-BOOL is_desktop_fullscreen(void) +BOOL is_window_rect_fullscreen_host( const RECT *rect ) { - RECT primary_rect = NtUserGetPrimaryMonitorRect(); - return (primary_rect.right - primary_rect.left == host_primary_rect.right - host_primary_rect.left && - primary_rect.bottom - primary_rect.top == host_primary_rect.bottom - host_primary_rect.top); + /* FIXME: support non-primary host monitor rect */ + return rect->right - rect->left == host_primary_rect.right - host_primary_rect.left && + rect->bottom - rect->top == host_primary_rect.bottom - host_primary_rect.top; }
-static void update_desktop_fullscreen( unsigned int width, unsigned int height) +static void update_desktop_fullscreen( const RECT *rect ) { Display *display = thread_display(); XEvent xev; @@ -116,10 +116,8 @@ static void update_desktop_fullscreen( unsigned int width, unsigned int height) xev.xclient.display = display; xev.xclient.send_event = True; xev.xclient.format = 32; - if (width == host_primary_rect.right - host_primary_rect.left && height == host_primary_rect.bottom - host_primary_rect.top) - xev.xclient.data.l[0] = _NET_WM_STATE_ADD; - else - xev.xclient.data.l[0] = _NET_WM_STATE_REMOVE; + if (is_window_rect_fullscreen_host( rect )) xev.xclient.data.l[0] = _NET_WM_STATE_ADD; + else xev.xclient.data.l[0] = _NET_WM_STATE_REMOVE; xev.xclient.data.l[1] = x11drv_atom(_NET_WM_STATE_FULLSCREEN); xev.xclient.data.l[2] = 0; xev.xclient.data.l[3] = 1; @@ -152,7 +150,7 @@ void X11DRV_resize_desktop(void) height = primary_rect.bottom;
TRACE( "desktop %p change to (%dx%d)\n", hwnd, width, height ); - update_desktop_fullscreen( width, height ); + update_desktop_fullscreen( &virtual_rect ); 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 ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 974bd376fe6..3442caeed56 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -747,7 +747,7 @@ static void set_mwm_hints( struct x11drv_win_data *data, UINT style, UINT ex_sty
if (data->hwnd == NtUserGetDesktopWindow()) { - if (is_desktop_fullscreen()) mwm_hints.decorations = 0; + if (is_window_rect_fullscreen_host( &data->whole_rect )) mwm_hints.decorations = 0; else mwm_hints.decorations = MWM_DECOR_TITLE | MWM_DECOR_BORDER | MWM_DECOR_MENU | MWM_DECOR_MINIMIZE; mwm_hints.functions = MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE | MWM_FUNC_CLOSE; } @@ -1906,7 +1906,7 @@ void X11DRV_SetDesktopWindow( HWND hwnd ) ERR( "Failed to create virtual desktop window data\n" ); root_window = DefaultRootWindow( gdi_display ); } - else if (is_desktop_fullscreen()) + else if (is_window_rect_fullscreen_host( &rect )) { Display *display = x11drv_thread_data()->display; TRACE("setting desktop to fullscreen\n"); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 3c41ce60854..88e6ca898fe 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -755,7 +755,7 @@ extern void X11DRV_Settings_SetHandler(const struct x11drv_settings_handler *han extern void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height ) DECLSPEC_HIDDEN; extern void X11DRV_resize_desktop(void) DECLSPEC_HIDDEN; extern BOOL is_virtual_desktop(void) DECLSPEC_HIDDEN; -extern BOOL is_desktop_fullscreen(void) DECLSPEC_HIDDEN; +extern BOOL is_window_rect_fullscreen_host( const RECT *rect ) DECLSPEC_HIDDEN; extern BOOL is_detached_mode(const DEVMODEW *) DECLSPEC_HIDDEN; void X11DRV_Settings_Init(void) DECLSPEC_HIDDEN;
Looks like it might not be enough, I'll try to reproduce.
This merge request was closed by Rémi Bernon.