diff options
author | Ernestas Kulik <ernestask@gnome.org> | 2018-10-04 15:14:30 +0300 |
---|---|---|
committer | Ernestas Kulik <ernestask@gnome.org> | 2018-10-04 16:50:36 +0300 |
commit | fa29a901a9760b07b5a04300cc85340d83c7aeb1 (patch) | |
tree | 49ad5bf20357859bdbe0aa13a0aa7e60fd64ca25 | |
parent | 69244cd4285898b7fc16e7b13f32e3038df0dad2 (diff) | |
download | nautilus-fa29a901a9760b07b5a04300cc85340d83c7aeb1.tar.gz |
pathbar: Claim path bar button presses
Since these are forwarded to the title bar, in cases where the middle
click does something special (e.g. minimize the window), unintended
side-effects might be observed in conjunction to opening the location in
a new tab. Claiming the sequence helps prevent that.
Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/671
-rw-r--r-- | src/nautilus-pathbar.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c index b3188d8de..54698ef90 100644 --- a/src/nautilus-pathbar.c +++ b/src/nautilus-pathbar.c @@ -1199,16 +1199,6 @@ on_multi_press_gesture_pressed (GtkGestureMultiPress *gesture, case GDK_BUTTON_SECONDARY: { - GdkEventSequence *sequence; - - /* Claim the event to prevent GtkWindow from popping up the window - * manager menu, since we are in the titlebar. - */ - sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); - gtk_gesture_set_sequence_state (GTK_GESTURE (gesture), - sequence, - GTK_EVENT_SEQUENCE_CLAIMED); - if (g_file_equal (button_data->path, self->current_path)) { gtk_popover_popup (self->current_view_menu_popover); @@ -1227,9 +1217,16 @@ on_multi_press_gesture_pressed (GtkGestureMultiPress *gesture, /* Ignore other buttons in this gesture. GtkButton will claim the * primary button presses and emit the "clicked" signal. */ + return; } break; } + + /* Both middle- and secondary-clicking the title bar can have interesting + * effects (minimizing the window, popping up a window manager menu, etc.), + * and this avoids all that. + */ + gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); } static GIcon * |