[eog] EogWindow: Fix deprecated usage of gtk_screen_get_monitor_*



commit 3516c2fc97b4202fb349a3f1fff220ca590793ad
Author: Felix Riemann <friemann gnome org>
Date:   Fri Feb 2 20:01:56 2018 +0100

    EogWindow: Fix deprecated usage of gtk_screen_get_monitor_*

 src/eog-window.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index 123b22c..4e91327 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -1236,8 +1236,8 @@ eog_window_obtain_desired_size (EogImage  *image,
                                gint       height,
                                EogWindow *window)
 {
-       GdkScreen *screen;
-       GdkRectangle monitor;
+       GdkMonitor *monitor;
+       GdkRectangle monitor_rect;
        GtkAllocation allocation;
        gint final_width, final_height;
        gint screen_width, screen_height;
@@ -1275,15 +1275,14 @@ eog_window_obtain_desired_size (EogImage  *image,
        eog_debug_message (DEBUG_WINDOW, "Initial Window Size: %d x %d", window_width, window_height);
 
 
-       screen = gtk_window_get_screen (GTK_WINDOW (window));
+       monitor = gdk_display_get_monitor_at_window (
+                               gtk_widget_get_display (GTK_WIDGET (window)),
+                               gtk_widget_get_window (GTK_WIDGET (window)));
 
-       gdk_screen_get_monitor_geometry (screen,
-                       gdk_screen_get_monitor_at_window (screen,
-                               gtk_widget_get_window (GTK_WIDGET (window))),
-                       &monitor);
+       gdk_monitor_get_geometry (monitor, &monitor_rect);
 
-       screen_width  = monitor.width;
-       screen_height = monitor.height;
+       screen_width  = monitor_rect.width;
+       screen_height = monitor_rect.height;
 
        eog_debug_message (DEBUG_WINDOW, "Screen Size: %d x %d", screen_width, screen_height);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]