Repository navigation
Fix focus loss during inline rename when pressing Alt+Shift - #3837
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.
|
Cannot reproduce in git master - you specify no environment/desktop... it's possible Cinnamon was causing this in 6.6, but no longer, and this really isn't the place to fix it anyhow. |
|
Environment (as requested): Zorin OS 18.1, X11, GNOME Shell (not Cinnamon), GTK 3.24.41, nemo 6.7.6 — recorded 2026-09-08, video in the PR description. Follow-up: after system updates on 2026-09-22 (GLib 2.80.0-6ubuntu3.8 → 3.9 among others) I can no longer reproduce this on current master, even manually — ~30 scripted XTEST runs (Alt+Shift bursts, bare Alt, timing variants, icon/list views) plus 4 manual variants (rename started from RU layout, immediate Alt+Shift, list view), with AT-SPI focus tracing confirming the rename entry never loses focus. So it was either fixed indirectly upstream or is timing/environment-specific. I will not push to reopen — but feel free to ping me if a guarded fix turns out to be worthwhile; I can reopen with the environment details above. |
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