summaryrefslogtreecommitdiff
path: root/gtk/gtkwidget.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-04-10 23:01:10 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-04-27 23:18:16 -0400
commitb5fb9ae3b74ae0c1d2a20bd24457ea228dd3f9e3 (patch)
treef15ff78a54d878f17efb41a37275407c5bf1bbec /gtk/gtkwidget.c
parent1b7d7c857f35e4834a522ced67dc0509445aae13 (diff)
downloadgtk+-b5fb9ae3b74ae0c1d2a20bd24457ea228dd3f9e3.tar.gz
gtk: Port to new monitor api
Use the GdkDisplay monitor api instead of the GdkScreen one.
Diffstat (limited to 'gtk/gtkwidget.c')
-rw-r--r--gtk/gtkwidget.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index ac86d9deda..2d4f430aa3 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10826,7 +10826,8 @@ gint
gtk_widget_get_scale_factor (GtkWidget *widget)
{
GtkWidget *toplevel;
- GdkScreen *screen;
+ GdkDisplay *display;
+ GdkMonitor *monitor;
g_return_val_if_fail (GTK_IS_WIDGET (widget), 1);
@@ -10840,11 +10841,10 @@ gtk_widget_get_scale_factor (GtkWidget *widget)
/* else fall back to something that is more likely to be right than
* just returning 1:
*/
- screen = gtk_widget_get_screen (widget);
- if (screen)
- return gdk_screen_get_monitor_scale_factor (screen, 0);
+ display = gtk_widget_get_display (widget);
+ monitor = gdk_display_get_monitor (display, 0);
- return 1;
+ return gdk_monitor_get_scale_factor (monitor);
}
/**