summaryrefslogtreecommitdiff
path: root/src/ui/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/ui.c')
-rw-r--r--src/ui/ui.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/ui/ui.c b/src/ui/ui.c
index 3c015f0c..b187f8cb 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -95,6 +95,7 @@ maybe_redirect_mouse_event (XEvent *xevent)
MetaUI *ui;
#if GTK_CHECK_VERSION (3, 0, 0)
GdkDeviceManager *gmanager;
+ GdkDevice *gdevice;
GdkEvent *gevent;
#else
GdkEvent gevent;
@@ -132,11 +133,20 @@ maybe_redirect_mouse_event (XEvent *xevent)
if (gdk_window == NULL)
return FALSE;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gmanager = gdk_display_get_device_manager (gdisplay);
+ gdevice = gdk_device_manager_get_client_pointer (gmanager);
+#endif
+
/* If GDK already thinks it has a grab, we better let it see events; this
* is the menu-navigation case and events need to get sent to the appropriate
* (client-side) subwindow for individual menu items.
*/
+#if GTK_CHECK_VERSION (3, 0, 0)
+ if (gdk_display_device_is_grabbed (gdisplay, gdevice))
+#else
if (gdk_display_pointer_is_grabbed (gdisplay))
+#endif
return FALSE;
#if !GTK_CHECK_VERSION (3, 0, 0)
@@ -245,8 +255,7 @@ maybe_redirect_mouse_event (XEvent *xevent)
/* If we've gotten here, we've filled in the gdk_event and should send it on */
#if GTK_CHECK_VERSION (3, 0, 0)
- gmanager = gdk_display_get_device_manager (gdisplay);
- gdk_event_set_device (gevent, gdk_device_manager_get_client_pointer (gmanager)); gtk_main_do_event (gevent);
+ gdk_event_set_device (gevent, gdevice);
gdk_event_free (gevent);
#else
gtk_main_do_event (&gevent);
@@ -464,6 +473,7 @@ meta_ui_map_frame (MetaUI *ui,
GdkWindow *window;
GdkDisplay *display;
+
display = gdk_x11_lookup_xdisplay (ui->xdisplay);
window = gdk_x11_window_lookup_for_display (display, xwindow);
@@ -478,6 +488,7 @@ meta_ui_unmap_frame (MetaUI *ui,
GdkWindow *window;
GdkDisplay *display;
+
display = gdk_x11_lookup_xdisplay (ui->xdisplay);
window = gdk_x11_window_lookup_for_display (display, xwindow);