diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2021-07-19 18:20:09 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2021-07-19 18:30:42 +0800 |
commit | ac64d2d910c3e5068f7376b55267aecc68489d79 (patch) | |
tree | e7ebb98ca3d7d618194d56e7a27d4e4d21b829cc /gdk/win32/gdkdrag-win32.c | |
parent | 49a76257cd832cf845eecf152fb374747b44626d (diff) | |
download | gtk+-ac64d2d910c3e5068f7376b55267aecc68489d79.tar.gz |
GDK-Win32: Clean up HiDPI support and WGL a bit
Make _gdk_win32_display_get_monitor_scale_factor() less complex, by:
* Drop the preceding underscore.
* Dropping an unused parameter.
* Using a GdkSurface instead of a HWND, as the HWND that we pass into
this function might have been taken from a GdkSurface, which are now
always created with CS_OWNDC. This means if a GdkSurface was passed
in, we ensure that we only acquire the DC from the HWND once, and do
not attempt to call ReleaseDC() on it.
* Store the HDC that we acquire from the GdkSurface's HWND into the
surface, and use that as the HDC we need for our GdkGLContext.
* Drop the gl_hwnd from GdkWin32Display, as that is really should be
stored in the GdkSurface.
* For functions that were updated, name GdkWin32Display variables as
display_win32 and GdkSurface variables as surface, to unify things.
* Stop calling ReleaseDC() on the HDC that we use for OpenGL, since
they were acquired from HWND's created with CS_OWNDC.
Diffstat (limited to 'gdk/win32/gdkdrag-win32.c')
-rw-r--r-- | gdk/win32/gdkdrag-win32.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdk/win32/gdkdrag-win32.c b/gdk/win32/gdkdrag-win32.c index 419889ebe1..1b92e85efa 100644 --- a/gdk/win32/gdkdrag-win32.c +++ b/gdk/win32/gdkdrag-win32.c @@ -793,7 +793,7 @@ gdk_drag_new (GdkDisplay *display, GdkDragProtocol protocol) { GdkWin32Drag *drag_win32; - GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (display); + GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display); GdkDrag *drag; drag_win32 = g_object_new (GDK_TYPE_WIN32_DRAG, @@ -805,10 +805,10 @@ gdk_drag_new (GdkDisplay *display, drag = GDK_DRAG (drag_win32); - if (win32_display->has_fixed_scale) - drag_win32->scale = win32_display->surface_scale; + if (display_win32->has_fixed_scale) + drag_win32->scale = display_win32->surface_scale; else - drag_win32->scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, NULL, NULL, NULL); + drag_win32->scale = gdk_win32_display_get_monitor_scale_factor (display_win32, NULL, NULL); drag_win32->protocol = protocol; |