Skip to content

fix(trash): honor focused button on permanent-delete Enter - #32

Draft
wmfeht wants to merge 4 commits into
mainfrom
fix/854-permanent-delete-enter
Draft

wmfeht wants to merge 4 commits into
mainfrom
fix/854-permanent-delete-enter

Conversation

@wmfeht

@wmfeht wmfeht commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Description

On the permanent-delete confirmation, Return and keypad Enter now activate the focused button (Cancel, confirm, or Close) instead of always confirming. Initial focus remains on confirm. Left / h still move focus to Cancel.

The Capture handler in show_delete_confirmation uses the same has_focus() lookup as paste/copy conflict dialogs. If no dialog button is focused, Enter proceeds so focus_navigation can still activate a focused control; it never falls back to confirm.

Visual evidence

N/A — keyboard activation only; no layout or CSS change.

How to test

  1. Select a file. Press Shift+Delete (or Delete on a location that cannot trash, such as /dev/shm) to open the permanent-delete confirmation.
  2. Press Left (or h) until Cancel has the focus ring. Press Enter, then repeat with keypad Enter.
  3. Open the dialog again and press Enter with the destructive confirm button still focused (initial focus).
  4. Open the dialog again, focus the Close (X) control, and press Enter.

Expected result: With Cancel or Close focused, the file stays and the dialog dismisses. With confirm focused, deletion still proceeds. Initial focus remains on confirm.

Related issue

Closes lgse#854

Open in Web Open in Cursor 

@wmfeht
wmfeht force-pushed the fix/854-permanent-delete-enter branch from 6c28859 to db3fda5 Compare September 16, 2026 00:00
Permanent-delete confirmation always activated confirm on Enter, even
after focus moved to Cancel. Activate the focused button instead,
matching paste and archive conflict dialogs. Confirm stays the initial
focus.

Defer initial grab_focus on delete and conflict prompts so GTK does
not show a keyboard highlight until the user moves focus.

Closes lgse#854
@wmfeht
wmfeht force-pushed the fix/854-permanent-delete-enter branch from db3fda5 to 5e3e83f Compare September 16, 2026 01:13
@github-actions
github-actions Bot force-pushed the main branch 4 times, most recently from 171d7a3 to 8e043ca Compare September 17, 2026 11:50
William Feht added 3 commits September 17, 2026 18:57
…elete-enter

Keep main's trash confirmation unit tests alongside the Enter-focus GTK coverage.
is_recent_root used GFile::has_uri_scheme and parent(), which SIGSEGV on
gphoto2 backends when tests call Location::parent concurrently.
@github-actions
github-actions Bot force-pushed the main branch 6 times, most recently from 51fba50 to b415eb6 Compare September 20, 2026 05:00
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.

fix(trash): honor focused button on permanent-delete Enter

1 participant