-
Notifications
You must be signed in to change notification settings - Fork 267
enhance: close all windows with ESC
#1509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I do not like this PR. ESC
should only close toolbox windows (normally a modal dialog). Windows like File Histories
, Blame
, Branch Compare
and Dir Histories
should not use ESC
to close.
AFAIK none of these windows have unsaved state that the user needs to commit, so what's the risk of providing a quick dismiss option? Nothing is lost if the user accidentally hits ESC
.
This has nothing to do with the content displayed within the window, but only with the window's own displaying mode.
Usually, if a window is independent of another window, has Minimize
and Maximize
buttons, and has Actived
and Deactived
states, the ESC
key will not be used to close the window.
For example: on macOS, we use system caption buttons instead of the custom CaptionButtons
view. When pressed the green button, the window will be changed to full-screen mode. And then user restore it using ESC
key.
I've never used macOS and have never seen ESC
used to restore a maximized window in Linux or Windows, so perhaps that's the reason for my disconnect here.
In that case, let's use ESC for these windows on Windows/Linux but not on Mac. I'm on Windows and am also very much used to these kinds of programs conveniently using ESC in all "spawned" (and stateless) windows except for the very top-level one (i.e the SourceGit main window).
Have you really encountered windows that can be closed using the ESC
key when it matches following rules:
- Has
minimized
,maximized
andrestore
buttons - Can be resized
- Has
Actived
andDeactived
states
Wireshark’s Preferences window adheres to this rule. However, even if you minimize this window, the main window remains disabled until the Preferences window is closed. However, it's more common to treat such pop-up windows like blame, history, etc., as dialog boxes—with only a close button—while still being standalone windows.
The WinMerge
tool offers several modes for this, in a single combo-box. As a frequent user of that tool, I find this flexibility awesome - it even allows (optionally) closing the main window with ESC. (It's using an MDI model, but the MDI windows are tileable & resizable and have min/max-imize and close buttons.)
NOTE: There's no real need to handle this differently in SourceGit on Mac - instead, this feature could be optional (in global Preferences) and disabled by default!
I no longer want to discuss this topic in depth because I have clarified the design principles of this software.
My muscle memory expects dialogs to be easily dismissed with
ESC
, so it's quite jarring when it doesn't work.This PR ensures all chromeless windows close when escape is pressed.