summaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2015-10-30 19:00:54 +0100
committerWolfgang Ulbrich <[email protected]>2015-10-30 19:00:54 +0100
commit9197308b8216362f729814ab1e1e0b953a7bad60 (patch)
tree359c66931ad3c300445769daf9b8bd875e6b3f5a /src/daemon
parent7d162d83a2008c25b3134fcdda8265f23d461585 (diff)
parent2fa13890b50108bd90b7b8e85cc1c3954642d8e1 (diff)
downloadmate-notification-daemon-9197308b8216362f729814ab1e1e0b953a7bad60.tar.bz2
mate-notification-daemon-9197308b8216362f729814ab1e1e0b953a7bad60.tar.xz
Merge pull request #81 from raveit65/dev-deprecated-gdk_display_get_pointer
GTK3 daemon: fix deprecated gdk_display_get_pointer
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/daemon.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index e0dd3e6..47c118e 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -1595,6 +1595,11 @@ gboolean notify_daemon_notify_handler(NotifyDaemon* daemon, const char* app_name
#if !GTK_CHECK_VERSION (3, 8, 0)
int screen_num;
#endif
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkDisplay *display;
+ GdkDeviceManager *device_manager;
+ GdkDevice *pointer;
+#endif
GdkScreen* screen;
gint x, y;
@@ -1605,7 +1610,15 @@ gboolean notify_daemon_notify_handler(NotifyDaemon* daemon, const char* app_name
* number the user has set in gsettings. */
if (g_settings_get_boolean(daemon->gsettings, GSETTINGS_KEY_USE_ACTIVE))
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ display = gdk_display_get_default ();
+ device_manager = gdk_display_get_device_manager (display);
+ pointer = gdk_device_manager_get_client_pointer (device_manager);
+
+ gdk_device_get_position (pointer, &screen, &x, &y);
+#else
gdk_display_get_pointer (gdk_display_get_default (), &screen, &x, &y, NULL);
+#endif
#if !GTK_CHECK_VERSION (3, 8, 0)
screen_num = gdk_screen_get_number (screen);
#endif