Commit 21bdf617 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

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
parent 323a5957
......@@ -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);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment