user: ChangeDisplaySettings virtual desktop mode handling fix (resend)

Jesse Allen the3dfxdude at gmail.com
Sat Sep 2 12:02:42 CDT 2006


Mike,

I looked at it again and I think this is the best spot for it. Here's a resend.

There were three places I considered:

1. In winex11's initialization, but that would change current behavior.

2. Inside winex11's ChangeDisplaySettings. This could work but it would only fix this driver.

3. The following patch. There is only one other place I can think of where the desktop window is created. The place is CreateWindow. I checked in user32 and CreateWindow makes calls to GetDesktopWindow. Inside winex11, its create window does not make any calls that create the desktop window. Therefore the calls to GetDesktopWindow in user32 creates the desktop window.

So the following patch keeps to the current method as much as possible. And I suppose if another driver is used besides winex11 then that driver will be able to make correct decisions to about mode changing with a virtual desktop.

Jesse


diff --git a/dlls/user/sysparams.c b/dlls/user/sysparams.c
index 8bb2114..9e476d5 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 )
 {
+    /* make sure the desktop window is created before mode changing */
+    GetDesktopWindow();
+
     return USER_Driver->pChangeDisplaySettingsEx( devname, devmode, hwnd, flags, lparam );
 }
 



More information about the wine-patches mailing list