Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- 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))