diff options
author | raveit65 <[email protected]> | 2016-06-27 00:31:42 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-07-04 14:40:52 +0200 |
commit | 78f10df5adf757025070f864a92a1916c78593fb (patch) | |
tree | 3120b9763351ace7a43a5bfe97a91910f1d0dc63 | |
parent | fecfeff6c34c1ac11c4803cb3ffc0b6722bd93b7 (diff) | |
download | caja-78f10df5adf757025070f864a92a1916c78593fb.tar.bz2 caja-78f10df5adf757025070f864a92a1916c78593fb.tar.xz |
Gtk+-3.20 fm-desktop-icon-view: use GdkSeat operations
-rw-r--r-- | src/file-manager/fm-desktop-icon-view.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c index 3022fcf2..0a67ab87 100644 --- a/src/file-manager/fm-desktop-icon-view.c +++ b/src/file-manager/fm-desktop-icon-view.c @@ -322,7 +322,37 @@ fm_desktop_icon_view_handle_middle_click (CajaIconContainer *icon_container, FMDesktopIconView *desktop_icon_view) { XButtonEvent x_event; -#if GTK_CHECK_VERSION (3, 0, 0) +#if GTK_CHECK_VERSION (3, 20, 0) + GdkDevice *keyboard = NULL, *pointer = NULL, *cur; + GdkSeat *seat; + + seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (icon_container))); + pointer = gdk_seat_get_pointer (seat); + keyboard = gdk_seat_get_keyboard (seat); + + { + if (pointer == NULL && (gdk_device_get_source (cur) == GDK_SOURCE_MOUSE)) { + pointer = cur; + } + + if (keyboard == NULL && (gdk_device_get_source (cur) == GDK_SOURCE_KEYBOARD)) { + keyboard = cur; + } + } + + /* During a mouse click we have the pointer and keyboard grab. + * We will send a fake event to the root window which will cause it + * to try to get the grab so we need to let go ourselves. + */ + + if (pointer != NULL) { + gdk_seat_ungrab (seat); + } + + if (keyboard != NULL) { + gdk_seat_ungrab (seat); + } +#elif GTK_CHECK_VERSION(3, 0, 0) GdkDevice *keyboard = NULL, *pointer = NULL, *cur; GdkDeviceManager *manager; GList *list, *l; |