diff options
author | monsta <[email protected]> | 2017-06-01 14:21:32 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-06-11 16:16:13 +0300 |
commit | ab0e7fdc5330f16441c2973163ccbadb11e3b113 (patch) | |
tree | bc5c20ae428729c69359573985f1750c25c70d16 | |
parent | 33bf97e09716abedf13d566e2c30ee0f0c8c44e6 (diff) | |
download | mate-panel-ab0e7fdc5330f16441c2973163ccbadb11e3b113.tar.bz2 mate-panel-ab0e7fdc5330f16441c2973163ccbadb11e3b113.tar.xz |
menu: restore focus after drag-n-dropping menuitem outside
-rw-r--r-- | mate-panel/menu.c | 55 |
1 files changed, 1 insertions, 54 deletions
diff --git a/mate-panel/menu.c b/mate-panel/menu.c index ad86e364..6b2858f1 100644 --- a/mate-panel/menu.c +++ b/mate-panel/menu.c @@ -669,60 +669,7 @@ drag_end_menu_cb (GtkWidget *widget, GdkDragContext *context) if (xgrab_shell) { - gboolean status; - GdkDisplay *display; - GdkDevice *pointer; - GdkDevice *keyboard; -#if GTK_CHECK_VERSION(3, 20, 0) - GdkSeat *seat; -#else - GdkDeviceManager *device_manager; -#endif - GdkWindow *window = gtk_widget_get_window (xgrab_shell); - GdkCursor *cursor = gdk_cursor_new_for_display (gdk_display_get_default (), - GDK_ARROW); - - display = gdk_window_get_display (window); -#if GTK_CHECK_VERSION(3, 20, 0) - seat = gdk_display_get_default_seat (display); - pointer = gdk_seat_get_pointer (seat); -#else - device_manager = gdk_display_get_device_manager (display); - pointer = gdk_device_manager_get_client_pointer (device_manager); -#endif - keyboard = gdk_device_get_associated_device (pointer); - - /* FIXMEgpoo: Not sure if report to GDK_OWNERSHIP_WINDOW - or GDK_OWNERSHIP_APPLICATION Idem for the - keyboard below */ - status = gdk_device_grab (pointer, window, - GDK_OWNERSHIP_WINDOW, TRUE, - GDK_BUTTON_PRESS_MASK - | GDK_BUTTON_RELEASE_MASK - | GDK_ENTER_NOTIFY_MASK - | GDK_LEAVE_NOTIFY_MASK - | GDK_POINTER_MOTION_MASK, - cursor, GDK_CURRENT_TIME); - - if (!status) - { - if (gdk_device_grab (keyboard, window, - GDK_OWNERSHIP_WINDOW, TRUE, - GDK_KEY_PRESS | GDK_KEY_RELEASE, - NULL, GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS) - { -/* FIXME fix for GTK3 */ -#if 0 - GTK_MENU_SHELL (xgrab_shell)->have_xgrab = TRUE; -#endif - } - else - { - gdk_device_ungrab (pointer, GDK_CURRENT_TIME); - } - } - - g_object_unref (cursor); + grab_widget (xgrab_shell); } } |