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
>From 5759a54d90876d2d0eadb2e0edab6c571616921e Mon Sep 17 00:00:00 2001
From: Rodrigo Arias Mallo <rodar...@gmail.com>
Date: Mon, 4 Aug 2025 23:08:08 +0200
Subject: [PATCH] Middle click in Home or Book opens in new tab

Open the Home page or the Bookmarks in a new tab if the button is
pressed with middle-click, following the same behavior for hyperlinks.
---
 src/ui.cc    | 16 ++++++++++------
 src/uicmd.cc | 16 ++++++++++++----
 src/uicmd.hh |  4 ++--
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/src/ui.cc b/src/ui.cc
index 9a01cdd5..eb3b0b75 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -331,7 +331,9 @@ static void b1_cb(Fl_Widget *wid, void *cb_data)
       break;
    case UI_HOME:
       if (b == FL_LEFT_MOUSE) {
-         a_UIcmd_home(a_UIcmd_get_bw_by_widget(wid));
+         a_UIcmd_home(a_UIcmd_get_bw_by_widget(wid), 0);
+      } else if (b == FL_MIDDLE_MOUSE) {
+         a_UIcmd_home(a_UIcmd_get_bw_by_widget(wid), 1);
       }
       break;
    case UI_RELOAD:
@@ -351,7 +353,9 @@ static void b1_cb(Fl_Widget *wid, void *cb_data)
       break;
    case UI_BOOK:
       if (b == FL_LEFT_MOUSE) {
-         a_UIcmd_book(a_UIcmd_get_bw_by_widget(wid));
+         a_UIcmd_book(a_UIcmd_get_bw_by_widget(wid), 0);
+      } else if (b == FL_MIDDLE_MOUSE) {
+         a_UIcmd_book(a_UIcmd_get_bw_by_widget(wid), 1);
       }
       break;
    case UI_TOOLS:
@@ -440,11 +444,11 @@ void UI::make_toolbar(int tw, int th)
 
    Back->set_tooltip("Previous page");
    Forw->set_tooltip("Next page");
-   Home->set_tooltip("Go to the Home page");
+   Home->set_tooltip("Go to the Home page\nMiddle-click for new tab.");
    Reload->set_tooltip("Reload");
    Save->set_tooltip("Save this page");
    Stop->set_tooltip("Stop loading");
-   Bookmarks->set_tooltip("View bookmarks");
+   Bookmarks->set_tooltip("View bookmarks\nMiddle-click for new tab.");
    Tools->set_tooltip("Settings");
 }
 
@@ -755,7 +759,7 @@ int UI::handle(int event)
          a_UIcmd_zoom_reset(a_UIcmd_get_bw_by_widget(this));
          ret = 1;
       } else if (cmd == KEYS_BOOKMARKS) {
-         a_UIcmd_book(a_UIcmd_get_bw_by_widget(this));
+         a_UIcmd_book(a_UIcmd_get_bw_by_widget(this), 0);
          ret = 1;
       } else if (cmd == KEYS_FIND) {
          findbar_toggle(1);
@@ -775,7 +779,7 @@ int UI::handle(int event)
          a_UIcmd_open_file(a_UIcmd_get_bw_by_widget(this));
          ret = 1;
       } else if (cmd == KEYS_HOME) {
-         a_UIcmd_home(a_UIcmd_get_bw_by_widget(this));
+         a_UIcmd_home(a_UIcmd_get_bw_by_widget(this), 0);
          ret = 1;
       } else if (cmd == KEYS_RELOAD) {
          a_UIcmd_reload(a_UIcmd_get_bw_by_widget(this));
diff --git a/src/uicmd.cc b/src/uicmd.cc
index 957bedd7..65ab772b 100644
--- a/src/uicmd.cc
+++ b/src/uicmd.cc
@@ -920,9 +920,12 @@ void a_UIcmd_forw_popup(void *vbw, int x, int y)
 /*
  * Send the browser to home URL
  */
-void a_UIcmd_home(void *vbw)
+void a_UIcmd_home(void *vbw, int nt)
 {
-   a_UIcmd_open_url((BrowserWindow*)vbw, prefs.home);
+   if (nt)
+      a_UIcmd_open_url_nt((BrowserWindow*)vbw, prefs.home, 1);
+   else
+      a_UIcmd_open_url((BrowserWindow*)vbw, prefs.home);
 }
 
 /*
@@ -1276,10 +1279,15 @@ void a_UIcmd_save_link(BrowserWindow *bw, const 
DilloUrl *url, char *filename)
 /*
  * Request the bookmarks page
  */
-void a_UIcmd_book(void *vbw)
+void a_UIcmd_book(void *vbw, int nt)
 {
    DilloUrl *url = a_Url_new("dpi:/bm/", NULL);
-   a_UIcmd_open_url((BrowserWindow*)vbw, url);
+
+   if (nt)
+      a_UIcmd_open_url_nt((BrowserWindow*)vbw, url, 1);
+   else
+      a_UIcmd_open_url((BrowserWindow*)vbw, url);
+
    a_Url_free(url);
 }
 
diff --git a/src/uicmd.hh b/src/uicmd.hh
index 7ef676e9..c0e03b4f 100644
--- a/src/uicmd.hh
+++ b/src/uicmd.hh
@@ -34,7 +34,7 @@ void a_UIcmd_back_popup(void *vbw, int x, int y);
 void a_UIcmd_forw(void *vbw);
 void a_UIcmd_forw_nt(void *vbw);
 void a_UIcmd_forw_popup(void *vbw, int x, int y);
-void a_UIcmd_home(void *vbw);
+void a_UIcmd_home(void *vbw, int nt);
 void a_UIcmd_copy(void *vbw);
 void a_UIcmd_zoom_in(void *vbw);
 void a_UIcmd_zoom_out(void *vbw);
@@ -51,7 +51,7 @@ void a_UIcmd_open_file(void *vbw);
 const char *a_UIcmd_select_file(void);
 void a_UIcmd_search_dialog(void *vbw);
 const char *a_UIcmd_get_passwd(const char *user);
-void a_UIcmd_book(void *vbw);
+void a_UIcmd_book(void *vbw, int nt);
 void a_UIcmd_add_bookmark(BrowserWindow *bw, const DilloUrl *url);
 void a_UIcmd_panels_toggle(BrowserWindow *bw);
 void a_UIcmd_findtext_dialog(BrowserWindow *bw);
-- 
2.50.1

_______________________________________________
Dillo-dev mailing list -- dillo-dev@mailman3.com
To unsubscribe send an email to dillo-dev-le...@mailman3.com

Reply via email to