Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
NathanBaulch wants to merge 1 commit into sourcegit-scm:develop from NathanBaulch:escape

Conversation

Copy link
Contributor

@NathanBaulch NathanBaulch commented Jul 4, 2025

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.

goran-w reacted with thumbs up emoji
Copy link
Collaborator

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.

NathanBaulch reacted with confused emoji goran-w reacted with eyes emoji

Copy link
Contributor Author

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.

goran-w reacted with thumbs up emoji

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Contributor

goran-w commented Jul 5, 2025
edited
Loading

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).

NathanBaulch reacted with thumbs up emoji

Copy link
Collaborator

Have you really encountered windows that can be closed using the ESC key when it matches following rules:

  • Has minimized, maximized and restore buttons
  • Can be resized
  • Has Actived and Deactived states

Copy link
Contributor

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.

image

Copy link
Collaborator

love-linger commented Jul 5, 2025 via email

It is because the preference window of Wireshark is still a modal dialog. Currently, for modal dialogs in SourceGit, users can close it by ESC key. The reason that the blame and histories windows are not dialogs is: - those windows are resizable - When these windows exist, the main window must be able to operate, such as when you click some sha

Copy link
Contributor

goran-w commented Jul 5, 2025
edited
Loading

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.)

image

image

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!

NathanBaulch reacted with thumbs up emoji

Copy link
Collaborator

I no longer want to discuss this topic in depth because I have clarified the design principles of this software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /