From 828c0715df2a60364fdb24ae73b2d034eca3333a Mon Sep 17 00:00:00 2001 From: Matthew D'Asaro Date: Thu, 10 Apr 2008 13:05:13 -0700 Subject: Add an option to winecfg which toggles between window decorations being drawn by the window manager or by wine. --- programs/winecfg/En.rc | 4 +++- programs/winecfg/resource.h | 1 + programs/winecfg/x11drvdlg.c | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletions(-) diff --git a/programs/winecfg/En.rc b/programs/winecfg/En.rc index 46d6c78..f31a0a9 100644 --- a/programs/winecfg/En.rc +++ b/programs/winecfg/En.rc @@ -64,7 +64,9 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX " Window Settings ",IDC_STATIC,8,4,244,184 - CONTROL "Allow DirectX apps to stop the &mouse leaving their window",IDC_DX_MOUSE_GRAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,19,230,8 + CONTROL "Allow DirectX apps to stop the &mouse leaving their window",IDC_DX_MOUSE_GRAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,20,230,8 + + CONTROL "Allow the window manager to &decorate the windows",IDC_ENABLE_DECORATED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,30,230,8 CONTROL "Allow the &window manager to control the windows",IDC_ENABLE_MANAGED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,40,230,8 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.", diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h index e92fe56..d90c7ae 100644 --- a/programs/winecfg/resource.h +++ b/programs/winecfg/resource.h @@ -143,6 +143,7 @@ #define IDS_NO_DRIVE_C /* graphics */ #define IDC_ENABLE_MANAGED 1100 +#define IDC_ENABLE_DECORATED 1101 #define IDC_DX_MOUSE_GRAB 1102 #define IDC_USE_TAKE_FOCUS 1103 #define IDC_DOUBLE_BUFFER 1104 diff --git a/programs/winecfg/x11drvdlg.c b/programs/winecfg/x11drvdlg.c index a631493..93d2cc7 100644 --- a/programs/winecfg/x11drvdlg.c +++ b/programs/winecfg/x11drvdlg.c @@ -147,6 +147,14 @@ static void init_dialog(HWND dialog) CheckDlgButton(dialog, IDC_ENABLE_MANAGED, BST_UNCHECKED); HeapFree(GetProcessHeap(), 0, buf); + buf = get_reg_key(config_key, keypath("X11 Driver"), "Decorated", "Y"); + if (IS_OPTION_TRUE(*buf)) + CheckDlgButton(dialog, IDC_ENABLE_DECORATED, BST_CHECKED); + else + CheckDlgButton(dialog, IDC_ENABLE_DECORATED, BST_UNCHECKED); + HeapFree(GetProcessHeap(), 0, buf); + + SendDlgItemMessage(dialog, IDC_D3D_VSHADER_MODE, CB_RESETCONTENT, 0, 0); for (it = 0; 0 != D3D_VS_Modes[it].displayStrID; ++it) { SendDlgItemMessageW (dialog, IDC_D3D_VSHADER_MODE, CB_ADDSTRING, 0, @@ -225,6 +233,16 @@ static void on_enable_managed_clicked(HW } } +static void on_enable_decorated_clicked(HWND dialog) { + WINE_TRACE("\n"); + + if (IsDlgButtonChecked(dialog, IDC_ENABLE_DECORATED) == BST_CHECKED) { + set_reg_key(config_key, keypath("X11 Driver"), "Decorated", "Y"); + } else { + set_reg_key(config_key, keypath("X11 Driver"), "Decorated", "N"); + } +} + static void on_dx_mouse_grab_clicked(HWND dialog) { if (IsDlgButtonChecked(dialog, IDC_DX_MOUSE_GRAB) == BST_CHECKED) set_reg_key(config_key, keypath("X11 Driver"), "DXGrab", "Y"); @@ -359,6 +377,7 @@ GraphDlgProc(HWND hDlg, UINT uMsg, WPARA switch(LOWORD(wParam)) { case IDC_ENABLE_DESKTOP: on_enable_desktop_clicked(hDlg); break; case IDC_ENABLE_MANAGED: on_enable_managed_clicked(hDlg); break; + case IDC_ENABLE_DECORATED: on_enable_decorated_clicked(hDlg); break; case IDC_DX_MOUSE_GRAB: on_dx_mouse_grab_clicked(hDlg); break; case IDC_D3D_PSHADER_MODE: on_d3d_pshader_mode_clicked(hDlg); break; } -- 1.4.1.1