diff options
author | Wolfgang Ulbrich <[email protected]> | 2015-10-30 12:41:05 +0100 |
---|---|---|
committer | Wolfgang Ulbrich <[email protected]> | 2015-10-30 18:33:54 +0100 |
commit | 2fa13890b50108bd90b7b8e85cc1c3954642d8e1 (patch) | |
tree | bf7cc4bc3804afed456eef0b0985ba62f336bea2 /src/daemon | |
parent | 6f7a01c386c72a8236bc0ad993698d3764a9006f (diff) | |
download | mate-notification-daemon-2fa13890b50108bd90b7b8e85cc1c3954642d8e1.tar.bz2 mate-notification-daemon-2fa13890b50108bd90b7b8e85cc1c3954642d8e1.tar.xz |
GTK3 daemon: fix deprecated gdk_display_get_pointer
inspired from:
https://git.gnome.org/browse/notification-daemon/patch/?id=9f376d3
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/daemon.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 92fcb0b..8d941f2 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 |