summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-08-14 15:07:42 +0200
committerraveit65 <[email protected]>2017-08-14 17:39:27 +0200
commitc64a516cbca7b8d07e5de0af9223ae0199e18857 (patch)
tree12554201c78a5d1d20ba60dc223dc2127f2adb3b
parentfc513ed9c042f2bcf80a196a38c2f4db2c45252d (diff)
downloadmarco-c64a516cbca7b8d07e5de0af9223ae0199e18857.tar.bz2
marco-c64a516cbca7b8d07e5de0af9223ae0199e18857.tar.xz
display: don't use deprecated GDK_DEVICE_MANAGER
use GtkSeat for > gtk+-3.20
-rw-r--r--src/core/display.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/display.c b/src/core/display.c
index e247ed33..9601b4ed 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1437,6 +1437,12 @@ static gboolean maybe_send_event_to_gtk(MetaDisplay* display, XEvent* xevent)
GdkEvent* gdk_event = NULL;
GdkWindow* gdk_window;
Window window;
+#if GTK_CHECK_VERSION (3, 20, 0)
+ GdkSeat *seat;
+#else
+ GdkDeviceManager *manager;
+#endif
+ GdkDevice *device;
switch (xevent->type)
{
@@ -1471,8 +1477,14 @@ static gboolean maybe_send_event_to_gtk(MetaDisplay* display, XEvent* xevent)
* (client-side) subwindow for individual menu items.
*/
- GdkDeviceManager *device_manager = gdk_display_get_device_manager (gdk_display);
- GdkDevice *device = gdk_device_manager_get_client_pointer (device_manager);
+#if GTK_CHECK_VERSION (3, 20, 0)
+ gdk_display = gdk_window_get_display (gdk_window);
+ seat = gdk_display_get_default_seat (gdk_display);
+ device = gdk_seat_get_pointer (seat);
+#else
+ manager = gdk_display_get_device_manager (gdk_display);
+ device = gdk_device_manager_get_client_pointer (manager);
+#endif
if (gdk_display_device_is_grabbed(gdk_display, device))
{