[winecfg] make winecfg and x11drv agree if desktop mode is enabled.

Rein Klazes wijn at wanadoo.nl
Tue Oct 18 01:54:02 CDT 2005


Hi,

Changelog:

programs/winecfg	: x11drvdlg.c

Show desktop mode disabled if the Desktop registry value exists but
starts with N,n,F,f or 0. This agrees with the logic in x11drv.

Rein. 
-------------- next part --------------
--- wine/programs/winecfg/x11drvdlg.c	2005-09-26 15:34:11.000000000 +0200
+++ mywine/programs/winecfg/x11drvdlg.c	2005-10-17 19:49:18.000000000 +0200
@@ -49,8 +49,9 @@ static const char* D3D_VS_Modes[] = {
 int updating_ui;
 
 static void update_gui_for_desktop_mode(HWND dialog) {
-    WINE_TRACE("\n");
+    int desktopenabed = FALSE;
 
+    WINE_TRACE("\n");
     updating_ui = TRUE;
     
     /* do we have desktop mode enabled? */
@@ -58,29 +59,32 @@ static void update_gui_for_desktop_mode(
     {
         char* buf, *bufindex;
 	CheckDlgButton(dialog, IDC_ENABLE_DESKTOP, BST_CHECKED);
-	
-	enable(IDC_DESKTOP_WIDTH);
-	enable(IDC_DESKTOP_HEIGHT);
-	enable(IDC_DESKTOP_SIZE);
-	enable(IDC_DESKTOP_BY);
 
         buf = get_reg_key(config_key, keypath("X11 Driver"), "Desktop", "640x480");
-        bufindex = strchr(buf, 'x');
-        if (bufindex) {
-            *bufindex = 0;
-            ++bufindex;
-            SetWindowText(GetDlgItem(dialog, IDC_DESKTOP_WIDTH), buf);
-            SetWindowText(GetDlgItem(dialog, IDC_DESKTOP_HEIGHT), bufindex);
-        } else {
-            WINE_TRACE("Desktop registry entry is malformed");
-            SetWindowText(GetDlgItem(dialog, IDC_DESKTOP_WIDTH), "640");
-            SetWindowText(GetDlgItem(dialog, IDC_DESKTOP_HEIGHT), "480");
-        }
+        /* note: this test must match the one in x11drv */
+        if( buf[0] != 'n' &&  buf[0] != 'N' &&  buf[0] != 'F' &&  buf[0] != 'f'
+                &&  buf[0] != '0') {
+            desktopenabed = TRUE;
+            enable(IDC_DESKTOP_WIDTH);
+            enable(IDC_DESKTOP_HEIGHT);
+            enable(IDC_DESKTOP_SIZE);
+            enable(IDC_DESKTOP_BY);
 
+            bufindex = strchr(buf, 'x');
+            if (bufindex) {
+                *bufindex = 0;
+                ++bufindex;
+                SetWindowText(GetDlgItem(dialog, IDC_DESKTOP_WIDTH), buf);
+                SetWindowText(GetDlgItem(dialog, IDC_DESKTOP_HEIGHT), bufindex);
+            } else {
+                WINE_TRACE("Desktop registry entry is malformed");
+                SetWindowText(GetDlgItem(dialog, IDC_DESKTOP_WIDTH), "640");
+                SetWindowText(GetDlgItem(dialog, IDC_DESKTOP_HEIGHT), "480");
+            }
+        }
         HeapFree(GetProcessHeap(), 0, buf);
     }
-    else
-    {
+    if( !desktopenabed) {
 	CheckDlgButton(dialog, IDC_ENABLE_DESKTOP, BST_UNCHECKED);
 	
 	disable(IDC_DESKTOP_WIDTH);


More information about the wine-patches mailing list