GdkWin32: Remove _gdk_display_hdc global variable

This commit is contained in:
Luca Bacci 2023-05-30 19:52:13 +02:00
parent 8861d0eb53
commit cbb3d3f177
4 changed files with 9 additions and 6 deletions

View File

@ -30,8 +30,6 @@
GdkDisplay *_gdk_display = NULL;
GdkDeviceManagerWin32 *_gdk_device_manager = NULL;
HDC _gdk_display_hdc;
int _gdk_input_ignore_core;
HKL _gdk_input_locale;

View File

@ -63,7 +63,6 @@ _gdk_win32_surfaceing_init (void)
if (gdk_synchronize)
GdiSetBatchLimit (1);
_gdk_display_hdc = CreateDC ("DISPLAY", NULL, NULL, NULL);
_gdk_input_locale = GetKeyboardLayout (0);
_gdk_win32_keymap_set_active_layout (win32_keymap, _gdk_input_locale);

View File

@ -266,8 +266,6 @@ extern GdkDisplay *_gdk_display;
extern GdkDeviceManagerWin32 *_gdk_device_manager;
extern HDC _gdk_display_hdc;
extern int _gdk_input_ignore_core;
/* These are thread specific, but GDK/win32 works OK only when invoked

View File

@ -113,7 +113,15 @@ _gdk_win32_get_setting (const char *name,
}
else if (strcmp ("gtk-font-name", name) == 0)
{
char *font_name = _get_system_font_name (_gdk_display_hdc);
char *font_name = NULL;
HDC hdc = NULL;
if ((hdc = GetDC (HWND_DESKTOP)) != NULL)
{
font_name = _get_system_font_name (hdc);
ReleaseDC (HWND_DESKTOP, hdc);
hdc = NULL;
}
if (font_name)
{