[gtk+] Implement gdk_screen_get_monitor_scale_factor generically
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Implement gdk_screen_get_monitor_scale_factor generically
- Date: Wed, 14 Sep 2016 10:45:34 +0000 (UTC)
commit 21bdf617cea13d0625e88d9cb0d03bd0df169e2d
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Sep 13 10:45:06 2016 -0400
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
gdk/gdkscreen.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/gdk/gdkscreen.c b/gdk/gdkscreen.c
index 85cb93f..2249e7e 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]