diff options
author | Wolfgang Ulbrich <[email protected]> | 2015-11-16 14:17:37 +0100 |
---|---|---|
committer | Wolfgang Ulbrich <[email protected]> | 2015-12-02 12:58:44 +0100 |
commit | 945789ca0706b02094a97e81443fac1f535b3025 (patch) | |
tree | 7ef810c82c3f9eff4b328bb07e8589021f0ed1ce | |
parent | 1c202058b5ad04b0947e2f00029d09f50fcc868b (diff) | |
download | mate-settings-daemon-945789ca0706b02094a97e81443fac1f535b3025.tar.bz2 mate-settings-daemon-945789ca0706b02094a97e81443fac1f535b3025.tar.xz |
GTK3 media-keys: don't use deprecated gdk_display_get_pointer
-rw-r--r-- | plugins/media-keys/msd-media-keys-manager.c | 16 |
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 d34e50b..77fb8c3 100644 --- a/plugins/media-keys/msd-media-keys-manager.c +++ b/plugins/media-keys/msd-media-keys-manager.c @@ -395,6 +395,11 @@ dialog_show (MsdMediaKeysManager *manager) int screen_h; int x; int y; +#if GTK_CHECK_VERSION (3, 0, 0) + GdkDisplay *display; + GdkDeviceManager *device_manager; + GdkDevice *pointer; +#endif int pointer_x; int pointer_y; GtkRequisition win_req; @@ -425,11 +430,22 @@ dialog_show (MsdMediaKeysManager *manager) } pointer_screen = NULL; +#if GTK_CHECK_VERSION (3, 0, 0) + display = gdk_screen_get_display (manager->priv->current_screen); + device_manager = gdk_display_get_device_manager (display); + pointer = gdk_device_manager_get_client_pointer (device_manager); + + gdk_device_get_position (pointer, + &pointer_screen, + &pointer_x, + &pointer_y); +#else gdk_display_get_pointer (gdk_screen_get_display (manager->priv->current_screen), &pointer_screen, &pointer_x, &pointer_y, NULL); +#endif if (pointer_screen != manager->priv->current_screen) { /* The pointer isn't on the current screen, so just * assume the default monitor |