summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-17 02:40:11 +0200
committerZenWalker <[email protected]>2017-08-17 03:28:00 +0200
commit392eb3dea2337bf35cb59917577ee52005f1ee80 (patch)
tree0469d4de69f88374910afc72350511e19bf86a0b
parenta8b83b4a99378466f914ca8026818fc6f71183ab (diff)
downloadmate-settings-daemon-392eb3dea2337bf35cb59917577ee52005f1ee80.tar.bz2
mate-settings-daemon-392eb3dea2337bf35cb59917577ee52005f1ee80.tar.xz
gtk 3.22: avoid deprecated gdk_screen_get_monitor... functions:
avoid deprecated: gdk_screen_get_monitor_geometry gdk_screen_get_monitor_at_point
-rw-r--r--plugins/media-keys/msd-media-keys-manager.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c
index 9533968..a9d36c1 100644
--- a/plugins/media-keys/msd-media-keys-manager.c
+++ b/plugins/media-keys/msd-media-keys-manager.c
@@ -401,7 +401,11 @@ dialog_show (MsdMediaKeysManager *manager)
GtkRequisition win_req;
GdkScreen *pointer_screen;
GdkRectangle geometry;
+#if GTK_CHECK_VERSION (3, 22, 0)
+ GdkMonitor *monitor;
+#else
int monitor;
+#endif
gtk_window_set_screen (GTK_WINDOW (manager->priv->dialog),
manager->priv->current_screen);
@@ -439,16 +443,28 @@ dialog_show (MsdMediaKeysManager *manager)
/* The pointer isn't on the current screen, so just
* assume the default monitor
*/
+#if GTK_CHECK_VERSION (3, 22, 0)
+ monitor = gdk_display_get_monitor (display, 0);
+#else
monitor = 0;
+#endif
} else {
+#if GTK_CHECK_VERSION (3, 22, 0)
+ monitor = gdk_display_get_monitor_at_point (display, pointer_x, pointer_y);
+#else
monitor = gdk_screen_get_monitor_at_point (manager->priv->current_screen,
pointer_x,
pointer_y);
+#endif
}
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gdk_monitor_get_geometry (monitor, &geometry);
+#else
gdk_screen_get_monitor_geometry (manager->priv->current_screen,
monitor,
&geometry);
+#endif
screen_w = geometry.width;
screen_h = geometry.height;