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 671121 - Escape key should leave top bar when it has keyboard focus
Escape key should leave top bar when it has keyboard focus
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.26.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-03-01 11:35 UTC by Stefano Facchini
Modified: 2017-11-01 19:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
panel: leave the panel when pressing Escape (2.12 KB, patch)
2012-03-01 11:35 UTC, Stefano Facchini
none Details | Review
main: add a 'Windows' item to CtrlAltTab also outside of overview (2.01 KB, patch)
2012-03-09 22:56 UTC, Stefano Facchini
reviewed Details | Review
main, panel: add a way to leave the panel after it gets keyboard focus (3.43 KB, patch)
2012-03-17 18:14 UTC, Stefano Facchini
none Details | Review
panel: focus windows on Escape key press (1.49 KB, patch)
2017-11-01 18:52 UTC, Stefano Facchini
committed Details | Review

Description Stefano Facchini 2012-03-01 11:35:16 UTC
After focusing the panel with Ctrl+Alt+Tab, there's no easy way "leave" it and give again focus to the current window.
Comment 1 Stefano Facchini 2012-03-01 11:35:36 UTC
Created attachment 208777 [details] [review]
panel: leave the panel when pressing Escape

Once the panel has keyboard focus, there is currently no easy way
to leave it with keyboard only. The behavior introduced here
is to focus the MRU window when pressing Escape, or simply to hide
the overview if it is visible.
Comment 2 Ray Strode [halfline] 2012-03-01 23:52:42 UTC
Maybe ctrl-alt-tab should show "Windows" like it does in the overview for getting back.
Comment 3 Stefano Facchini 2012-03-09 22:56:32 UTC
Created attachment 209365 [details] [review]
main: add a 'Windows' item to CtrlAltTab also outside of overview

There is currently no intuitive way to leave the panel once it
gets keyboard focus, so add this one.

Moreover, the CtrlAltTab popup with only one element is weird.
Comment 4 Rui Matos 2012-03-16 19:49:10 UTC
Review of attachment 209365 [details] [review]:

::: js/ui/main.js
@@ +251,3 @@
     }
 
+    let dummyWindowGroupWidget = new St.Widget({ name: 'dummyWindowGroupWidget' });

In practice it probably won't matter but I think it's better to set opacity: 0.

@@ +273,3 @@
+function _focusWindowGroup() {
+    let screen = global.screen;
+    let display = screen.get_display();

Just use global.display.
Comment 5 Rui Matos 2012-03-16 19:56:06 UTC
Review of attachment 208777 [details] [review]:

I think this behavior is still useful and both patches could be merged.
Comment 6 Rui Matos 2012-03-16 20:00:47 UTC
Review of attachment 209365 [details] [review]:

It would be nice if the switcher showed up initially like

+------+
| W [P]|
+------+

and when changing from the panel (P) to windows (W) like

+------+
| P [W]|
+------+
Comment 7 Stefano Facchini 2012-03-17 18:14:53 UTC
Created attachment 210010 [details] [review]
main, panel: add a way to leave the panel after it gets keyboard focus

There is currently no intuitive way to leave the panel once it gets
keyboard focus. The behavior introduced here is to focus the MRU
window when:

    * hitting Escape
    * choosing a newly added 'Windows' entry from Ctrl-Alt-Tab popup

--
Merged the two patches and amended, and thanks for review :)

As for your suggestion of changing the order of icons in the popup, I'm not
sure about it, for two reasons:
1. in the overview the order is fixed, and try to mirror the order of the
   elements in the screen.
2. outside the overview, the Ctrl-Alt-Tab popup might contain icons for windows
   in the MetaTabList.DOCKS list (again in fixed order): it seems odd to arrange
   only _some_ icons according to recent usage.
And changing this behavior can be left for another bug.
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-06-01 12:07:21 UTC
Review of attachment 210010 [details] [review]:

This would have to be updated to work with the new session mode stuff, and a bunch of other fancy new improvements, but sure.

::: js/ui/main.js
@@ +261,3 @@
+                                                 opacity: 0 });
+    uiGroup.add_actor(dummyWindowGroupWidget);
+    ctrlAltTabManager.addGroup(dummyWindowGroupWidget, _("Windows"), 'text-x-generic',

Given how many dummy groups we have, I wonder if it would just be better to modify CtrlAltYabManager to just accept null.

@@ +263,3 @@
+    ctrlAltTabManager.addGroup(dummyWindowGroupWidget, _("Windows"), 'text-x-generic',
+                               { sortGroup: CtrlAltTab.SortGroup.TOP,
+                                 focusCallback: focusWindowGroup });

You can use the "proxy" parameter to give a fake mapped variable, instead of this thing.
Comment 9 Rui Matos 2012-12-06 09:55:17 UTC
Oh, I knew there was something like this already somewhere. Jasper has just re-implemented the windows item part of this in bug 689653. Returning the focus to the windows using Escape would still be nice though.
Comment 10 Alexandre Franke 2017-11-01 17:18:35 UTC
Any chance you can update the patch, Stefano?
Comment 11 Stefano Facchini 2017-11-01 18:52:18 UTC
Created attachment 362775 [details] [review]
panel: focus windows on Escape key press

Here it goes :)
But it's totally untested, I can't easily rebuild the shell right now.
Comment 12 Florian Müllner 2017-11-01 19:11:49 UTC
Review of attachment 362775 [details] [review]:

Commit message could be better, but *shrug* - code looks good (and works as advertised)
Comment 13 Stefano Facchini 2017-11-01 19:53:56 UTC
Attachment 362775 [details] pushed as feed029 - panel: focus windows on Escape key press