Skip to content

Conversation

@beyondcompute
Copy link
Contributor

Note

The need for such a change was discussed here: #3913 (review) (Another related PR: #3905)

This is an AI-assisted 🤖 attempt to address the old issue of needing to assign the window-closing keyboard shortcuts (Ctrl/Cmd+W, on those platforms where they are standardized) manually to each modal, dialog and a window.

Maybe Windows users could advise on whether we should address Windows shortcuts as well?

Before this change, developer needed to add such a handler to each window/dialog separately
because global Ctrl/Cmd+W handler was added in a previous commit
@beyondcompute beyondcompute force-pushed the global-window-closing-keyboard-shortcut branch from 160ad71 to 815c8a4 Compare December 23, 2025 11:07
@abdnh
Copy link
Collaborator

abdnh commented Dec 31, 2025

This appears to be working well If I enable it for Windows. Both Ctrl+W and Ctrl+F4 are returned by QKeySequence.keyBindings(QKeySequence.StandardKey.Close) on Windows. I suggest we limit it to macOS though, because on Windows Esc and Alt+F4 work for the same purpose as dae said.

@beyondcompute
Copy link
Contributor Author

Thanks for the feedback! What about *nix? There has been a wish for this expressed, for example, here: #3905 (comment)

@abdnh
Copy link
Collaborator

abdnh commented Dec 31, 2025

Will leave that to Linux users to comment on. With Alt+F4 and Esc already working on Linux, I think it's better not to add more shortcuts to avoid conflicts.

@GithubAnon0000
Copy link
Contributor

On linux it is unlikely that Ctrl+w is going to cause conflicts with e.g. system shortcuts, since Ctrl+w is quite commonly used (e.g. to close tabs in applications). Personally, I'd vote for the Ctrl+w shortcut to be usable on linux, as I think this is more common than Esc or even Alt+F4; but maybe that just reflects my personal usage patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants