b4n left a comment (geany/geany#4279)

I don't have a strong opinion on this, apart from indeed the fear some people 
might lose their menubar (yet, as it's unbound by default, and refuses to hide 
if unbound, it's probably not *that* risky -- but people are forgetful, 
especially if they enabled that to try it out and stopped using it since then).

However, I think to be usable it should behave more like e.g. Firefox's hidden 
menubar, that is still react to <kbd>F10</kbd>, or event better, menu menmonics.
<details>
<summary>Patch for Firefox-like <kbd>F10</kbd> support that seem to work 
surprisingly well</summary>

```diff
diff --git a/src/keybindings.c b/src/keybindings.c
index ec9718b4e..f5f41ec10 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -75,6 +75,8 @@ static const gboolean swap_alt_tab_order = FALSE;
 /* central keypress event handler, almost all keypress events go to this 
function */
 static gboolean on_key_press_event(GtkWidget *widget, GdkEventKey *event, 
gpointer user_data);
 
+static void on_menubar_deactivate(GtkMenuShell *shell, gpointer data);
+
 static gboolean check_current_word(GeanyDocument *doc, gboolean sci_word);
 static gboolean read_current_word(GeanyDocument *doc, gboolean sci_word);
 static gchar *get_current_word_or_sel(GeanyDocument *doc, gboolean sci_word);
@@ -755,6 +757,9 @@ void keybindings_init(void)
        gtk_window_add_accel_group(GTK_WINDOW(main_widgets.window), 
kb_accel_group);
 
        g_signal_connect(main_widgets.window, "key-press-event", 
G_CALLBACK(on_key_press_event), NULL);
+       g_signal_connect(ui_lookup_widget(main_widgets.window, "menubar1"),
+                       "deactivate", G_CALLBACK(on_menubar_deactivate),
+                       ui_lookup_widget(main_widgets.window, "hbox_menubar"));
 }
 
 
@@ -1124,6 +1129,18 @@ static gboolean check_fixed_kb(guint keyval, guint state)
                        return TRUE;
                }
        }
+       /* temporarily show the menubar again when triggering it while hidden */
+       if (state == 0 && keyval == GDK_KEY_F10 && ! ui_prefs.menubar_visible)
+       {
+               GtkWidget *const geany_menubar_box = 
ui_lookup_widget(main_widgets.window, "hbox_menubar");
+               GtkWidget *const geany_menubar = 
ui_lookup_widget(main_widgets.window, "menubar1");
+
+               gtk_widget_show(geany_menubar_box);
+               gtk_menu_shell_select_first(GTK_MENU_SHELL(geany_menubar), 
TRUE);
+
+               return TRUE;
+       }
+       /* FIXME: handle Alt to focus the menu bar? */
        return FALSE;
 }
 
@@ -1621,6 +1638,13 @@ static void cb_func_menu_opencolorchooser(G_GNUC_UNUSED 
guint key_id)
 }
 
 
+static void on_menubar_deactivate(GtkMenuShell *shell, gpointer data)
+{
+       if (! ui_prefs.menubar_visible)
+               gtk_widget_hide(data);
+}
+
+
 static void on_toggle_menubar(GtkMenuItem *menuitem, gpointer user_data)
 {
        GtkWidget *geany_menubar = ui_lookup_widget(main_widgets.window, 
"hbox_menubar");
```
</details>

Not sure how to do the mnemonics yet though (but I didn't try yet either).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/4279#issuecomment-2746555458
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/4279/c2746555...@github.com>

Reply via email to