diff options
author | Denis Gorodnichev <[email protected]> | 2014-10-27 13:26:39 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-10-27 13:26:39 +0100 |
commit | e2f29ace20f74e1e62e80ba13d8d6bbe36d65212 (patch) | |
tree | 9ab3a153ca960f9e4820f2972f281bb53b95256a /src/ui | |
parent | aaa378feaff4331c8c78afb390f99d867ddf9b88 (diff) | |
download | marco-e2f29ace20f74e1e62e80ba13d8d6bbe36d65212.tar.bz2 marco-e2f29ace20f74e1e62e80ba13d8d6bbe36d65212.tar.xz |
Fixup Gtk3 Gdk device handling
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/frames.c | 10 | ||||
-rw-r--r-- | src/ui/ui.c | 15 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c index d9c7ea1c..e4db182d 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -2027,7 +2027,12 @@ meta_frames_motion_notify_event (GtkWidget *widget, MetaFrameControl control; int x, y; +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_window_get_device_position (frame->window, event->device, + &x, &y, NULL); +#else gdk_window_get_pointer (frame->window, &x, &y, NULL); +#endif /* Control is set to none unless it matches * the current grab @@ -2072,7 +2077,12 @@ meta_frames_motion_notify_event (GtkWidget *widget, MetaFrameControl control; int x, y; +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_window_get_device_position (frame->window, event->device, + &x, &y, NULL); +#else gdk_window_get_pointer (frame->window, &x, &y, NULL); +#endif control = get_control (frames, frame, x, y); 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); |