GNOME Bugzilla – Bug 687267
middle mouse button click should close tab clicked
Last modified: 2020-11-24 09:58:38 UTC
As I'm used to from other apps with tabs support, I'd expect clicking with the middle mouse button on a tab should close it. This works for firefox, eclipse,... It would be great if gedit would support the same behavior.
Created attachment 266238 [details] [review] button-press-event() added.
This is something that has been requested several times. If somewhere should be requested or fixed is in gtk+ and afaik they are not interested in such feature. I am closing this as WONTFIX but feel free to open a bug report in gtk+ itself.
to clarify, after some discussion we reopened the bug. We need to check with the design team if middle-click-to-close is something we want. If yes, the patch looks fine to me (except tabs-vs-spaces)
Created attachment 266239 [details] [review] tab-spaces aligned.
Created attachment 266240 [details] [review] tab-spaces aligned. (hope so this time did correct)
Created attachment 266242 [details] [review] changes made according to spaces nd tabs.
Review of attachment 266242 [details] [review]: See the comments inline. ::: gedit/gedit-tab-label.c @@ +120,3 @@ + GeditTabLabel *tab_label) +{ + if (event->button == 2) this 2 has a define in Gdk that should be used. @@ +301,3 @@ tab_label); + g_signal_connect_after (ebox, + "button-press-event", here there should be only one tab and the rest should be spaces to align
Created attachment 266243 [details] [review] GDK_BUTTON_MIDDLE added. and aligned properly.
As a convenience shortcut I like this, especially when it's established in popular applications. One possible problem area is when/if we start using tabs in the headerbar[1] putting two behaviors against each other, one being destructive. So far no such app exists. [1] https://github.com/gnome-design-team/gnome-mockups/blob/master/web/experiments/headerbar-only/06-two-pages.png
Created attachment 266245 [details] [review] squashed the commits.
Review of attachment 266245 [details] [review]: Almost there. ::: gedit/gedit-tab-label.c @@ +117,3 @@ static void +tab_button_press_event (GtkWidget *widget, + GdkEventButton *event, here the alignment is wrong, they should be all spaces
Created attachment 266250 [details] [review] tabs replaced by the spaces
Review of attachment 266250 [details] [review]: Looks good to me. Please fix the commit subject and message. As it is now, it's not informative. You can cleanup this message by using git --amend. Just delete everything there was before and write a new, clean message as to what this patch does.
Created attachment 266523 [details] [review] Done with the changes.
This is an issue that should be dealt with in nautilus and epiphany as well.
*** Bug 751526 has been marked as a duplicate of this bug. ***
Fixed in commit c01dda948340c8cec20a7fb0d41ab47e5f52839c *** This bug has been marked as a duplicate of bug 780799 ***
Whoops, this is gedit, I've misread it. I'm sorry for the noise.
Mass-closing of all gedit bugzilla tickets. Special "code" to find again all those gedit bugzilla tickets that were open before the mass-closing: 2bfe1b0590a78457e1f1a6a90fb975f5878cb60064ccfe1d7db76ca0da52f0f3 By searching the above sha256sum in bugzilla, the gedit contributors can find again the tickets. We may be interested to do so when we work on a specific area of the code, to at least know the known problems and possible enhancements. We do this mass-closing because bugzilla.gnome.org is being replaced by gitlab.gnome.org.