[winecfg 11] More x11drv pane work

Mike Hearn mike at theoretic.com
Mon Sep 15 07:19:33 CDT 2003


Mike Hearn <mike at theoretic.com>
- Implement "managed mode" setting
- Make system colors setting work
- Disable DGA setting, as enabling it breaks wine

diff -ur --exclude-from=diff-exclusions ../head/programs/winecfg/En.rc programs/winecfg/En.rc
--- ../head/programs/winecfg/En.rc	2003-09-11 17:38:19.000000000 +0100
+++ programs/winecfg/En.rc	2003-09-15 12:28:56.000000000 +0100
@@ -62,24 +62,36 @@
 STYLE WS_CHILD | WS_DISABLED
 FONT 8, "MS Sans Serif"
 BEGIN
+/** DGA control is disabled until this feature isn't totally broken **/
+/*
     CONTROL         "Use XFree DGA extension",IDC_XDGA,"Button",
                     BS_AUTOCHECKBOX | WS_TABSTOP,145,44,97,10
-    CONTROL         "Enable Wine desktop",IDC_ENABLE_DESKTOP,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,17,110,84,10
+ */
+
     EDITTEXT        IDC_DESKTOP_WIDTH,64,125,40,14,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
     EDITTEXT        IDC_DESKTOP_HEIGHT,117,125,40,14,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
-    GROUPBOX        "Render Settings",IDC_STATIC,8,4,244,60
+    GROUPBOX        " Render Settings ",IDC_STATIC,8,4,244,60
     LTEXT           "The driver color and render settings are used to optimise the way in which colors and applications are displayed.",
                     IDC_STATIC,15,17,228,22
 		    
     LTEXT           "Allocated system colors:",IDC_STATIC,15,43,76,8
     EDITTEXT        IDC_SYSCOLORS,90,41,40,14,ES_AUTOHSCROLL | ES_NUMBER
     
-    GROUPBOX        "Wine Desktop",IDC_STATIC,8,65,244,83
-    LTEXT           "Wine can be setup to emulate a windows desktop, or can be run in ""Managed"" mode (default) where the default X11 windows manager/environment is resposible for placing the windows.",
+    GROUPBOX        " Window settings ",IDC_STATIC,8,65,244,170
+
+    /* FIXME: the wording of this explanation could be a lot better */
+    LTEXT           "You can choose to emulate a windows desktop, where all the windows are confined to one 'virtual screen', or you can have the windows placed on your standard desktop.",
                     IDC_STATIC,15,77,228,28
     LTEXT           "Desktop size:",IDC_DESKTOP_SIZE,17,125,44,8,WS_DISABLED
     LTEXT           "X",IDC_DESKTOP_BY,108,125,8,8,WS_DISABLED
+    CONTROL         "Emulate a virtual desktop",IDC_ENABLE_DESKTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,17,110,84,10
+
+    LTEXT 	    "If windows are managed by your window manager, then they will have the standard borders, they will respect your virtual desktop and appear in your window list. \n\nIf the windows are unmanaged, they will be disconnected from your window manager. This will mean the windows do not integrate as closely with your desktop, but the emulation will be more accurate so it can help some programs to work better.",
+    		    IDC_STATIC,15,145,228,50
+    CONTROL	    "Allow the window manager to control the windows", IDC_ENABLE_MANAGED, "Button",
+    		    BS_AUTOCHECKBOX | WS_TABSTOP, 17,215,154,10
+    
 END
 
 IDD_DLLCFG DIALOG DISCARDABLE  0, 0, 260, 250
diff -ur --exclude-from=diff-exclusions ../head/programs/winecfg/resource.h programs/winecfg/resource.h
--- ../head/programs/winecfg/resource.h	2003-09-11 17:38:19.000000000 +0100
+++ programs/winecfg/resource.h	2003-09-15 12:24:53.000000000 +0100
@@ -102,3 +102,4 @@
 #define IDC_STATIC_LABEL                1073
 #define IDC_ENABLE_DESKTOP              1074
 #define IDS_DRIVE_NO_C                  1075
+#define IDC_ENABLE_MANAGED              1076
diff -ur --exclude-from=diff-exclusions ../head/programs/winecfg/winecfg.c programs/winecfg/winecfg.c
--- ../head/programs/winecfg/winecfg.c	2003-09-15 13:13:06.000000000 +0100
+++ programs/winecfg/winecfg.c	2003-09-15 12:36:02.000000000 +0100
@@ -32,6 +32,9 @@
  *   - Multimedia page
  *   - Settings migration code (from old configs)
  *
+ *   Minor things that should be done someday:
+ *   - Make the desktop size UI a combo box, with a Custom option, so it's more obvious what you might want to choose here
+ *
  */
 
 #include <assert.h>
@@ -290,3 +293,4 @@
     return result;
 }
 
+
diff -ur --exclude-from=diff-exclusions ../head/programs/winecfg/x11drvdlg.c programs/winecfg/x11drvdlg.c
--- ../head/programs/winecfg/x11drvdlg.c	2003-09-08 20:38:45.000000000 +0100
+++ programs/winecfg/x11drvdlg.c	2003-09-15 12:52:07.000000000 +0100
@@ -89,7 +89,17 @@
     free(buf);
 
     SendDlgItemMessage(hDlg, IDC_DESKTOP_WIDTH, EM_LIMITTEXT, RES_MAXLEN, 0);
-    SendDlgItemMessage(hDlg, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0);    
+    SendDlgItemMessage(hDlg, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0);
+
+    buf = getConfigValue("x11drv", "AllocSysColors", "100");
+    SetWindowText(GetDlgItem(hDlg, IDC_SYSCOLORS), buf);
+    free(buf);
+
+    buf = getConfigValue("x11drv", "Managed", "Y");
+    if (IS_OPTION_TRUE(*buf))
+	CheckDlgButton(hDlg, IDC_ENABLE_MANAGED, BST_CHECKED);
+    else
+	CheckDlgButton(hDlg, IDC_ENABLE_MANAGED, BST_UNCHECKED);
     
     updatingUI = FALSE;
 }
@@ -130,7 +140,25 @@
     }
     updateGUIForDesktopMode(hDlg);
 }
+
+void onSysColorsChange(HWND hDlg) {
+    char *newvalue = getDialogItemText(hDlg, IDC_SYSCOLORS);
     
+    WINE_TRACE("\n");
+    if (updatingUI) return;
+    if (!newvalue) return;
+
+    addTransaction("x11drv", "AllocSystemColors", ACTION_SET, newvalue);
+    free(newvalue);
+}
+
+void onEnableManagedClicked(HWND hDlg) {
+    if (IsDlgButtonChecked(hDlg, IDC_ENABLE_MANAGED) == BST_CHECKED)
+	addTransaction("x11drv", "Managed", ACTION_SET, "Y");
+    else
+	addTransaction("x11drv", "Managed", ACTION_SET, "N");
+}
+
 INT_PTR CALLBACK
 X11DrvDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
@@ -143,12 +171,14 @@
 		case EN_CHANGE: {
 		    SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
 		    if ( (LOWORD(wParam) == IDC_DESKTOP_WIDTH) || (LOWORD(wParam) == IDC_DESKTOP_HEIGHT) ) setFromDesktopSizeEdits(hDlg);
+		    if (LOWORD(wParam) == IDC_SYSCOLORS) onSysColorsChange(hDlg);
 		    break;
 		}
 		case BN_CLICKED: {
 		    WINE_TRACE("%d\n", LOWORD(wParam));
 		    switch(LOWORD(wParam)) {
 			case IDC_ENABLE_DESKTOP: onEnableDesktopClicked(hDlg); break;
+			case IDC_ENABLE_MANAGED: onEnableManagedClicked(hDlg); break;
 		    };
 		    break;
 		}





More information about the wine-patches mailing list