From 2fa13890b50108bd90b7b8e85cc1c3954642d8e1 Mon Sep 17 00:00:00 2001 From: Wolfgang Ulbrich Date: Fri, 30 Oct 2015 12:41:05 +0100 Subject: GTK3 daemon: fix deprecated gdk_display_get_pointer inspired from: https://git.gnome.org/browse/notification-daemon/patch/?id=9f376d3 --- src/daemon/daemon.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/daemon') 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 @@ -1594,6 +1594,11 @@ gboolean notify_daemon_notify_handler(NotifyDaemon* daemon, const char* app_name int monitor_num; #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 -- cgit v1.2.1