diff options
Diffstat (limited to 'plugins/media-keys/msd-media-keys-manager.c')
-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 |