summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-09-13 10:45:06 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-09-14 06:45:21 -0400
commit21bdf617cea13d0625e88d9cb0d03bd0df169e2d (patch)
treed30dec24f1dfcd7b7f70a8d5b4f2a231edc85dd4 /gdk
parent323a59577b861250f010cfc1d1dd675b7edabc07 (diff)
downloadgtk+-21bdf617cea13d0625e88d9cb0d03bd0df169e2d.tar.gz
Implement gdk_screen_get_monitor_scale_factor generically
This was forgotten when the other screen monitor apis were ported to GdkMonitor. https://bugzilla.gnome.org/show_bug.cgi?id=771349
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkscreen.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gdk/gdkscreen.c b/gdk/gdkscreen.c
index 85cb93ffc4..2249e7ef30 100644
--- a/gdk/gdkscreen.c
+++ b/gdk/gdkscreen.c
@@ -1095,16 +1095,15 @@ gint
gdk_screen_get_monitor_scale_factor (GdkScreen *screen,
gint monitor_num)
{
- GdkScreenClass *screen_class;
+ GdkMonitor *monitor;
g_return_val_if_fail (GDK_IS_SCREEN (screen), 1);
g_return_val_if_fail (monitor_num >= 0, 1);
g_return_val_if_fail (monitor_num < gdk_screen_get_n_monitors (screen), 1);
- screen_class = GDK_SCREEN_GET_CLASS (screen);
+ monitor = get_monitor (screen, monitor_num);
- if (screen_class->get_monitor_scale_factor)
- return screen_class->get_monitor_scale_factor (screen, monitor_num);
+ g_return_val_if_fail (monitor != NULL, 1);
- return 1;
+ return gdk_monitor_get_scale_factor (monitor);
}