Gijs Vermeulen : winecfg: Disable virtual desktop when using macdrv.
Alexandre Julliard
julliard at winehq.org
Tue Oct 26 09:40:30 CDT 2021
Module: wine
Branch: stable
Commit: e2e053ea57e8aef9411d38fc99c83419a4c40b56
URL: https://source.winehq.org/git/wine.git/?a=commit;h=e2e053ea57e8aef9411d38fc99c83419a4c40b56
Author: Gijs Vermeulen <gijsvrm at gmail.com>
Date: Wed Aug 18 14:06:35 2021 +0200
winecfg: Disable virtual desktop when using macdrv.
Signed-off-by: Gijs Vermeulen <gijsvrm at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit e2db7ef7f47b667962f533691aa1ef0246264076)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
programs/winecfg/x11drvdlg.c | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/programs/winecfg/x11drvdlg.c b/programs/winecfg/x11drvdlg.c
index fbc6716e94e..34b194d04a6 100644
--- a/programs/winecfg/x11drvdlg.c
+++ b/programs/winecfg/x11drvdlg.c
@@ -111,17 +111,44 @@ static void update_gui_for_desktop_mode(HWND dialog)
updating_ui = FALSE;
}
+static BOOL can_enable_desktop(void)
+{
+ char *value;
+ UINT guid_atom;
+ BOOL ret = FALSE;
+ char key[sizeof("System\\CurrentControlSet\\Control\\Video\\{}\\0000") + 40];
+
+ guid_atom = HandleToULong(GetPropA(GetDesktopWindow(), "__wine_display_device_guid"));
+ strcpy( key, "System\\CurrentControlSet\\Control\\Video\\{" );
+ if (!GlobalGetAtomNameA(guid_atom, key + strlen(key), 40)) return ret;
+ strcat( key, "}\\0000" );
+ if ((value = get_reg_key(HKEY_LOCAL_MACHINE, key, "GraphicsDriver", NULL)))
+ {
+ if(strcmp(value, "winemac.drv"))
+ ret = TRUE;
+ HeapFree(GetProcessHeap(), 0, value);
+ }
+ return ret;
+}
+
static void init_dialog(HWND dialog)
{
char* buf;
+ BOOL enable_desktop;
convert_x11_desktop_key();
- update_gui_for_desktop_mode(dialog);
+ if ((enable_desktop = can_enable_desktop()))
+ update_gui_for_desktop_mode(dialog);
+ else
+ disable(IDC_ENABLE_DESKTOP);
updating_ui = TRUE;
- SendDlgItemMessageW(dialog, IDC_DESKTOP_WIDTH, EM_LIMITTEXT, RES_MAXLEN, 0);
- SendDlgItemMessageW(dialog, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0);
+ if (enable_desktop)
+ {
+ SendDlgItemMessageW(dialog, IDC_DESKTOP_WIDTH, EM_LIMITTEXT, RES_MAXLEN, 0);
+ SendDlgItemMessageW(dialog, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0);
+ }
buf = get_reg_key(config_key, keypath("X11 Driver"), "GrabFullscreen", "N");
if (IS_OPTION_TRUE(*buf))
More information about the wine-cvs
mailing list