From: Luca Bacci Date: Fri, 4 Nov 2022 14:54:02 +0000 (+0100) Subject: GdkWin32: Detect the high contrast setting X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~119^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=45681c4fe502b18a346f36a7c2488ec611f414ea;p=gtk4.git GdkWin32: Detect the high contrast setting And set the theme name accordingly ("Default-hc") --- diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c index 9b65b8d86a..5a5b12253a 100644 --- a/gdk/win32/gdkproperty-win32.c +++ b/gdk/win32/gdkproperty-win32.c @@ -147,6 +147,23 @@ _gdk_win32_get_setting (const char *name, g_value_set_boolean (value, FALSE); return TRUE; } + else if (strcmp ("gtk-theme-name", name) == 0) + { + HIGHCONTRASTW hc; + memset (&hc, 0, sizeof (hc)); + hc.cbSize = sizeof (hc); + if (API_CALL (SystemParametersInfoW, (SPI_GETHIGHCONTRAST, sizeof (hc), &hc, 0))) + { + if (hc.dwFlags & HCF_HIGHCONTRASTON) + { + const char *theme_name = "Default-hc"; + + GDK_NOTE(MISC, g_print("gdk_display_get_setting(\"%s\") : %s\n", name, theme_name)); + g_value_set_string (value, theme_name); + return TRUE; + } + } + } else if (strcmp ("gtk-xft-antialias", name) == 0) { GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : 1\n", name));