[PATCH] Open a new tab by middle clicking on tab close button

Hi, This patch enables the 'tab close' button to open a new tab when middle-clicked. This allows us to open a new tab with just one click instead of two. Of course it is possible to add a separate button for this, but to prevent clutter this might be a better solution. Regards, Alex diff -upr a/src/uicmd.cc b/src/uicmd.cc --- a/src/uicmd.cc Sat Jul 26 21:03:50 2025 +++ b/src/uicmd.cc Wed Jul 30 12:23:52 2025 @@ -223,6 +223,9 @@ static void close_tab_btn_cb (Fl_Widget *, void *cb_da if (b == FL_LEFT_MOUSE) { a_UIcmd_close_bw(a_UIcmd_get_bw_by_widget(tabs->wizard()->value())); } + if (b == FL_MIDDLE_MOUSE) { + a_UIcmd_open_url_nt(a_UIcmd_get_bw_by_widget(tabs->wizard()->value()), NULL, 1); + } } int CustTabs::handle(int e)

Hi Alex, On Wed, Jul 30, 2025 at 12:39:01PM +0000, a1ex@dismail.de wrote:
Hi,
This patch enables the 'tab close' button to open a new tab when middle-clicked. This allows us to open a new tab with just one click instead of two. Of course it is possible to add a separate button for this, but to prevent clutter this might be a better solution.
Thanks, but I don't like too much the idea of mixing closing and opening a tab in the same button (not a very objective argument either, I'm aware). I agree that adding a new button for opening a new tab would clutter the UI. I was thinking in clicking the empty space after the tab to open a new one. If there is no empty space, you cannot use this shortcut, so we passively encourage you to close some tabs to always leave some space. On Firefox this is done by double clicking. In any case, I seem to always use Ctrl+T for new tabs. Best, Rodrigo.

Hi Rodrigo, Rodrigo Arias <rodarima@gmail.com> wrote:
This patch enables the 'tab close' button to open a new tab when middle-clicked. This allows us to open a new tab with just one click instead of two. Of course it is possible to add a separate button for this, but to prevent clutter this might be a better solution.
Thanks, but I don't like too much the idea of mixing closing and opening a tab in the same button (not a very objective argument either, I'm aware). I agree that adding a new button for opening a new tab would clutter the UI.
It seemed like the most straight-forward approach while using an existing element. This might be controversial, but what about changing the 'close tab' button to be just for opening a new tab? The close tab button is redundant, because we can just right-click (or middle-click) the tab to close it, so it's not really needed.
I was thinking in clicking the empty space after the tab to open a new one. If there is no empty space, you cannot use this shortcut, so we passively encourage you to close some tabs to always leave some space. On Firefox this is done by double clicking.
This seems reasonable, but perhaps less discoverable (I didn't know about that in Firefox until just now). In either case, I think it would be nice to have a feature like 'always show tab bar', even if there is only one tab open. Because in order to open a second tab, you would need to use another means, since that element would initially not be visible.
In any case, I seem to always use Ctrl+T for new tabs.
Sure, but by that logic we could just do away with all of the buttons, since everything can be done by keyboard. I personally feel that we should strive for maximum accessibility, which includes mouse-centric workflows. Regards, Alex

Hi, For now I think we can safely add this patch (attached also): https://github.com/dillo-browser/dillo/pull/427.patch It opens the home and bookmark pages in a new tab if middle-clicked. It is not the same as opening a new blank tab, but it can probably cover some of the cases where you open a new tab just to go to the home page or bookmarks. The rationale is that we already open links in new tab when middle clicking, and both Home and Book are like links, so I think it makes sense.
This seems reasonable, but perhaps less discoverable (I didn't know about that in Firefox until just now). In either case, I think it would be nice to have a feature like 'always show tab bar', even if there is only one tab open. Because in order to open a second tab, you would need to use another means, since that element would initially not be visible.
Yeah, if we need to always show the tab bar then is not such a good idea. I'll need a bit of time to think about it. Best, Rodrigo

Hi, Rodrigo Arias <rodarima@gmail.com> wrote:
For now I think we can safely add this patch (attached also):
https://github.com/dillo-browser/dillo/pull/427.patch
It opens the home and bookmark pages in a new tab if middle-clicked. It is not the same as opening a new blank tab, but it can probably cover some of the cases where you open a new tab just to go to the home page or bookmarks.
The rationale is that we already open links in new tab when middle clicking, and both Home and Book are like links, so I think it makes sense.
I have tested this patch and it gets the job done nicely, thank you! Regards, Alex
participants (2)
-
a1ex@dismail.de
-
Rodrigo Arias