summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-20 18:59:56 +0200
committerraveit65 <[email protected]>2016-06-24 11:27:16 +0200
commitdaca69be40ba1ea5e765a18b2a1185cafca2128c (patch)
tree99188c479712c74a54ac0a932f69d8155a2661c7
parentb68dc9cd412767a8aa22c94663d229a5896d5546 (diff)
downloadmate-notification-daemon-daca69be40ba1ea5e765a18b2a1185cafca2128c.tar.bz2
mate-notification-daemon-daca69be40ba1ea5e765a18b2a1185cafca2128c.tar.xz
GTK+-3.20 daemon: avoid deprecated GdkDeviceManager
-rw-r--r--src/daemon/daemon.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index ca357cb..cb5260c 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -1470,7 +1470,11 @@ gboolean notify_daemon_notify_handler(NotifyDaemon* daemon, const char* app_name
{
int monitor_num;
GdkDisplay *display;
+#if GTK_CHECK_VERSION (3, 20, 0)
+ GdkSeat *seat;
+#else
GdkDeviceManager *device_manager;
+#endif
GdkDevice *pointer;
GdkScreen* screen;
gint x, y;
@@ -1483,8 +1487,13 @@ gboolean notify_daemon_notify_handler(NotifyDaemon* daemon, const char* app_name
if (g_settings_get_boolean(daemon->gsettings, GSETTINGS_KEY_USE_ACTIVE))
{
display = gdk_display_get_default ();
+#if GTK_CHECK_VERSION (3, 20, 0)
+ seat = gdk_display_get_default_seat (display);
+ pointer = gdk_seat_get_pointer (seat);
+#else
device_manager = gdk_display_get_device_manager (display);
pointer = gdk_device_manager_get_client_pointer (device_manager);
+#endif
gdk_device_get_position (pointer, &screen, &x, &y);
monitor_num = gdk_screen_get_monitor_at_point (screen, x, y);