[evince] ev-view-presentation: remove deprecated GdkScreen functions
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] ev-view-presentation: remove deprecated GdkScreen functions
- Date: Thu, 16 Jan 2020 01:59:15 +0000 (UTC)
commit 0765fecac157831e53a0dbd29793be2059944b74
Author: Jason Crain <jcrain inspiresomeone us>
Date: Sun Jan 12 12:34:56 2020 -0700
ev-view-presentation: remove deprecated GdkScreen functions
GdkScreen's monitor functions are deprecated since gdk 3.22.
EvViewPresentation's gtk_window_set_transient_for() function uses
gdk_screen_get_monitor_geometry() to get the monitor size. Replace this
with gdk_monitor_get_geometry().
Issue #1023
libview/ev-view-presentation.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index 012503df..8f551997 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -1285,14 +1285,18 @@ ev_view_presentation_motion_notify_event (GtkWidget *widget,
static void
ev_view_presentation_update_monitor_geometry (EvViewPresentation *pview)
{
- GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (pview));
- GdkRectangle monitor;
- gint monitor_num;
-
- monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (GTK_WIDGET (pview)));
- gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
- pview->monitor_width = monitor.width;
- pview->monitor_height = monitor.height;
+ GdkDisplay *display;
+ GdkWindow *window;
+ GdkMonitor *monitor;
+ GdkRectangle geometry;
+
+ display = gtk_widget_get_display (GTK_WIDGET (pview));
+ window = gtk_widget_get_window (GTK_WIDGET (pview));
+ monitor = gdk_display_get_monitor_at_window (display, window);
+ gdk_monitor_get_geometry (monitor, &geometry);
+
+ pview->monitor_width = geometry.width;
+ pview->monitor_height = geometry.height;
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]