Fix focus loss during inline rename when pressing Alt+Shift - #3837
Open
dronov-dmitry wants to merge 1 commit into
Open
Fix focus loss during inline rename when pressing Alt+Shift#3837dronov-dmitry wants to merge 1 commit into
dronov-dmitry wants to merge 1 commit into
Conversation
Consuming bare Alt key press/release events during rename to prevent GTK from interpreting them as menubar toggle triggers, which caused the rename entry to lose focus and cancel the rename operation. Affects Icon View, List View, and Compact View.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When renaming a file or folder (F2) in Nemo, pressing Alt+Shift to switch keyboard
layout causes the rename text entry to lose focus. The rename operation is cancelled
and the file returns to its original name. This affects all three view modes:
Icon View, List View, and Compact View.
Root Cause
The rename guard at
nemo-window.ccorrectly bypasses Nemo's own acceleratorbindings, but does NOT prevent GTK from processing the unhandled Alt key event.
The unhandled bare Alt key falls through to GTK's default handler, which interprets
it as a menubar toggle trigger, causing focus loss on the rename entry.
Fix
Consume bare Alt key press/release events during rename in
nemo_window_key_press_event()andnemo_window_key_release_event()before GTKcan process them as menubar toggles.
Testing
Additional test cases:
Video:
https://youtu.be/pSitfxwCchM