diff --git a/thunar/thunar-preferences-dialog.c b/thunar/thunar-preferences-dialog.c index 7a1f9c1217e00ab607e5c3d3af899c47502ce6ce..dd19f6d02fa14bad7435c11d53f1769570241681 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 25ff9cd23c4c23ad05514fe3208632d375c4b133..e0d0cf9f99f6674c003e008d0dab8699fcf3d1ac 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);