user: ChangeDisplaySettings virtual desktop mode handling fix

Jesse Allen the3dfxdude at
Thu Aug 31 13:07:49 CDT 2006

Some apps call ChangeDisplaySettings before creating a window. What currently happens with virtual desktop set is this allows mode changing with xrandr before the desktop window is created to handle the mode changing. After the mode change, the desktop window gets created anyway. So what needs to be done is to make sure the desktop window is created before the mode changing occurs.

This fixes a problem found with the user monitor test and virtual desktop set.

diff --git a/dlls/user/sysparams.c b/dlls/user/sysparams.c
index 8bb2114..23fed82 100644
--- a/dlls/user/sysparams.c
+++ b/dlls/user/sysparams.c
@@ -2964,6 +2964,9 @@ LONG WINAPI ChangeDisplaySettingsExA( LP
 LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND hwnd,
                                       DWORD flags, LPVOID lparam )
+    HWND desktop = NULL;
+    /* make sure the desktop window is created before mode changing */
+    desktop = GetDesktopWindow();
     return USER_Driver->pChangeDisplaySettingsEx( devname, devmode, hwnd, flags, lparam );

More information about the wine-patches mailing list