From 9903923828e50ddce969252e696d59e69f9803fc Mon Sep 17 00:00:00 2001
From: Andre Miranda <andreldm@xfce.org>
Date: Sat, 2 Jun 2018 01:49:18 -0300
Subject: [PATCH] Replace gdk_monitor_get_geometry

---
 thunar/thunar-preferences-dialog.c | 6 +++---
 thunar/thunar-window.c             | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/thunar/thunar-preferences-dialog.c b/thunar/thunar-preferences-dialog.c
index 7a1f9c121..dd19f6d02 100644
--- a/thunar/thunar-preferences-dialog.c
+++ b/thunar/thunar-preferences-dialog.c
@@ -754,7 +754,7 @@ thunar_preferences_dialog_new (GtkWindow *parent)
   gint          root_x, root_y;
   gint          window_width, window_height;
   gint          dialog_width, dialog_height;
-  gint          monitor;
+  GdkMonitor *  monitor;
   GdkRectangle  geometry;
   GdkScreen    *screen;
 
@@ -774,8 +774,8 @@ thunar_preferences_dialog_new (GtkWindow *parent)
       gtk_window_get_size (GTK_WINDOW (dialog), &dialog_width, &dialog_height);
 
       /* get the monitor geometry of the monitor with the parent window */
-      monitor = gdk_screen_get_monitor_at_point (screen, root_x, root_y);
-      gdk_screen_get_monitor_geometry (screen, monitor, &geometry);
+      monitor = gdk_display_get_monitor_at_point (gdk_display_get_default (), root_x, root_y);
+      gdk_monitor_get_geometry (monitor, &geometry);
 
       /* center the dialog on the window and clamp on the monitor */
       root_x += (window_width - dialog_width) / 2;
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 25ff9cd23..e0d0cf9f9 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -1731,7 +1731,7 @@ thunar_window_notebook_create_window (GtkWidget    *notebook,
   GtkWidget         *new_window;
   ThunarApplication *application;
   gint               width, height;
-  gint               monitor_num;
+  GdkMonitor        *monitor;
   GdkScreen         *screen;
   GdkRectangle       geo;
 
@@ -1758,8 +1758,8 @@ thunar_window_notebook_create_window (GtkWidget    *notebook,
   if (x >= 0 && y >= 0)
     {
       /* get the monitor geometry */
-      monitor_num = gdk_screen_get_monitor_at_point (screen, x, y);
-      gdk_screen_get_monitor_geometry (screen, monitor_num, &geo);
+      monitor = gdk_display_get_monitor_at_point (gdk_display_get_default (), x, y);
+      gdk_monitor_get_geometry (monitor, &geo);
 
       /* calculate window position, but keep it on the current monitor */
       x = CLAMP (x - width / 2, geo.x, geo.x + geo.width - width);
-- 
GitLab