GDK W32: Init display scale to the global Windows scale, not 1
authorРуслан Ижбулатов <lrn1986@gmail.com>
Sat, 24 Mar 2018 10:05:34 +0000 (10:05 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Sat, 24 Mar 2018 10:09:54 +0000 (10:09 +0000)
This affects gdk_device_query_state() for the virtual device. It has
no window, and is forced to query the display itself, and display
defaults its scale to 1 even for HiDPI desktops. Use the same
"query scale of a NULL monitor" trick that we use in other places
to get the global desktop scale.

https://bugzilla.gnome.org/show_bug.cgi?id=773299

gdk/win32/gdkdisplay-win32.c

index c0358ab1190e37a0a0fb4c6ea6848034390bc44e..821124ee3f0b1a3ef2ae192d1831508fed164bff 100644 (file)
@@ -972,7 +972,7 @@ gdk_win32_display_init (GdkWin32Display *display)
       display->has_fixed_scale = TRUE;
     }
   else
-    display->surface_scale = 1;
+    display->surface_scale = _gdk_win32_display_get_monitor_scale_factor (display, NULL, NULL, NULL);
 
   _gdk_win32_display_init_cursors (display);
   gdk_win32_display_check_composited (display);