After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735511 - too hard to move focus from the header bar to the text area
too hard to move focus from the header bar to the text area
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
3.13.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on: 735545
Blocks:
 
 
Reported: 2014-08-27 12:30 UTC by Paolo Bonzini
Modified: 2014-08-28 19:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
focus active view on 'Escape' (3.18 KB, patch)
2014-08-27 14:03 UTC, sébastien lafargue
committed Details | Review
patch (3.80 KB, patch)
2014-08-27 21:13 UTC, Paolo Borelli
none Details | Review
patch (5.20 KB, patch)
2014-08-28 06:20 UTC, Paolo Borelli
committed Details | Review

Description Paolo Bonzini 2014-08-27 12:30:56 UTC
While F10 moves focus from the text area to the header bar, getting back to the text area requires multiple TAB keypresses.

I suggest using ESC for this purpose.

Also, I think F10 should focus the gear/hamburger menu rather than the Open button.
Comment 1 sébastien lafargue 2014-08-27 14:03:12 UTC
Created attachment 284605 [details] [review]
focus active view on 'Escape'
Comment 2 sébastien lafargue 2014-08-27 14:05:58 UTC
Review of attachment 284605 [details] [review]:

commited as cf8b96a
Comment 3 Paolo Bonzini 2014-08-27 14:39:21 UTC
(14:43:46) pbor: I do not think we do anything specific with F10
(14:44:02) pbor: I guess focusing the headerbar is some weird side effect
(14:44:24) pbor: we should definitely make it pop up the gear menu

slaf, should I open a separate bug for F10?
Comment 4 sébastien lafargue 2014-08-27 19:05:32 UTC
paolo, hi, it's fine on this bug, i'll do this soon
Comment 5 Paolo Borelli 2014-08-27 19:52:03 UTC
I was taking a quick look, and started out with the following patch, but it needs a bugfix in gtk, so I filed bug #735545

Anyway this is trickier than how it looks at first sight since
 - we need to handle switch between toggling the normal and the fullscreen button
 - when toggling the fullscreen button we need to show/hide the bar
 - when dismissing the popover we need to focus the view


diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index 7a4231e..ef77587 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -575,6 +575,7 @@ gedit_app_startup (GApplication *application)
 	add_accelerator (app, "app.quit", "<Primary>Q");
 	add_accelerator (app, "app.help", "F1");
 
+	add_accelerator (app, "win.gear-menu", "F10");
 	add_accelerator (app, "win.open", "<Primary>O");
 	add_accelerator (app, "win.save", "<Primary>S");
 	add_accelerator (app, "win.save-as", "<Primary><Shift>S");
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index d8de113..f8b99c7 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -2667,7 +2667,23 @@ extension_removed (PeasExtensionSet *extensions,
 	gedit_window_activatable_deactivate (GEDIT_WINDOW_ACTIVATABLE (exten));
 }
 
+static void
+gedit_window_toggle_gear_menu (GSimpleAction *action,
+                               GVariant      *state,
+                               gpointer       user_data)
+{
+	GeditWindow *window = GEDIT_WINDOW (user_data);
+	gboolean open;
+
+	open = g_variant_get_boolean (state);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (window->priv->gear_button),
+	                              open);
+
+	g_simple_action_set_state (action, state);
+}
+
 static GActionEntry win_entries[] = {
+	{ "gear-menu", NULL, NULL, "false", gedit_window_toggle_gear_menu },
 	{ "new-tab", _gedit_cmd_file_new },
 	{ "open", _gedit_cmd_file_open },
 	{ "revert", _gedit_cmd_file_revert },
Comment 6 Paolo Borelli 2014-08-27 21:13:43 UTC
Created attachment 284640 [details] [review]
patch

actually I think I found a more elegant way to solve it by using a g_property_action... However the fullscreen part is tricky with all the magic to handle enter/leave events for the bar autohide. Slaf: can you double check?
Comment 7 sébastien lafargue 2014-08-27 21:52:32 UTC
pbor, add this in gedit_window_init :

window->priv->fullscreen_eventbox_leave_state = TRUE;
Comment 8 Paolo Borelli 2014-08-28 06:20:44 UTC
Created attachment 284658 [details] [review]
patch

Thanks for the suggestion. I changed the name of the variable to in_fullscreen_eventbox (reversing the boolean values) since I think it is more readable.

This will go in as soon as the GTK patch is accepted
Comment 9 Ignacio Casal Quinteiro (nacho) 2014-08-28 06:41:51 UTC
Review of attachment 284658 [details] [review]:

I'd say push already the parts that just change the name?
Comment 10 Paolo Borelli 2014-08-28 19:17:07 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.