From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/desktop.c | 6 ------ dlls/winex11.drv/display.c | 9 +-------- dlls/winex11.drv/window.c | 6 +++--- dlls/winex11.drv/x11drv.h | 2 -- dlls/winex11.drv/xrandr.c | 3 ++- 5 files changed, 6 insertions(+), 20 deletions(-)
diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 721e805f820..c6a08291f6a 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -467,12 +467,6 @@ void X11DRV_resize_desktop(void) width = primary_rect.right; height = primary_rect.bottom;
- if (NtUserGetWindowThread( hwnd, NULL ) != GetCurrentThreadId()) - { - send_message( hwnd, WM_X11DRV_RESIZE_DESKTOP, 0, 0 ); - return; - } - TRACE( "desktop %p change to (%dx%d)\n", hwnd, width, height ); update_desktop_fullscreen( width, height ); NtUserSetWindowPos( hwnd, 0, virtual_rect.left, virtual_rect.top, diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 87f7adb76d2..572b81aa491 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -419,7 +419,7 @@ LONG X11DRV_ChangeDisplaySettings( LPDEVMODEW displays, HWND hwnd, DWORD flags, if (ret == DISP_CHANGE_SUCCESSFUL) ret = apply_display_settings( displays, ids, TRUE ); if (ret == DISP_CHANGE_SUCCESSFUL) - X11DRV_DisplayDevices_Update(); + X11DRV_DisplayDevices_Init(TRUE);
done: free( ids ); @@ -558,13 +558,6 @@ void X11DRV_DisplayDevices_RegisterEventHandlers(void) handler->register_event_handlers(); }
-void X11DRV_DisplayDevices_Update(void) -{ - X11DRV_DisplayDevices_Init(TRUE); - - X11DRV_resize_desktop(); -} - static BOOL force_display_devices_refresh;
BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, BOOL force, void *param ) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 7f4a92abe5f..70a29d24fb1 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1893,6 +1893,9 @@ LRESULT X11DRV_DesktopWindowProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) case WM_WINE_ADD_TAB: send_notify_message( (HWND)wp, WM_X11DRV_ADD_TAB, 0, 0 ); break; + case WM_DISPLAYCHANGE: + X11DRV_resize_desktop(); + break; } return NtUserMessageCall( hwnd, msg, wp, lp, 0, NtUserDefWindowProc, FALSE ); } @@ -2993,9 +2996,6 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) release_win_data( data ); } return 0; - case WM_X11DRV_RESIZE_DESKTOP: - X11DRV_resize_desktop(); - return 0; case WM_X11DRV_DESKTOP_RESIZED: if ((data = get_win_data( hwnd ))) { diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index fc646771acd..f8f8fe3d4d1 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -572,7 +572,6 @@ enum x11drv_window_messages { WM_X11DRV_UPDATE_CLIPBOARD = 0x80001000, WM_X11DRV_SET_WIN_REGION, - WM_X11DRV_RESIZE_DESKTOP, WM_X11DRV_DESKTOP_RESIZED, WM_X11DRV_SET_CURSOR, WM_X11DRV_CLIP_CURSOR_NOTIFY, @@ -805,7 +804,6 @@ extern BOOL get_host_primary_gpu(struct gdi_gpu *gpu) DECLSPEC_HIDDEN; extern void X11DRV_DisplayDevices_SetHandler(const struct x11drv_display_device_handler *handler) DECLSPEC_HIDDEN; extern void X11DRV_DisplayDevices_Init(BOOL force) DECLSPEC_HIDDEN; extern void X11DRV_DisplayDevices_RegisterEventHandlers(void) DECLSPEC_HIDDEN; -extern void X11DRV_DisplayDevices_Update(void) DECLSPEC_HIDDEN; /* Display device handler used in virtual desktop mode */ extern struct x11drv_display_device_handler desktop_handler DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index a0ac2cb5ec1..c7f922b1aae 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -1198,8 +1198,9 @@ static BOOL xrandr14_device_change_handler( HWND hwnd, XEvent *event ) xrandr14_invalidate_current_mode_cache(); if (hwnd == NtUserGetDesktopWindow() && NtUserGetWindowThread( hwnd, NULL ) == GetCurrentThreadId()) { - X11DRV_DisplayDevices_Update(); + X11DRV_DisplayDevices_Init( TRUE ); init_registry_display_settings(); + X11DRV_resize_desktop(); } return FALSE; }