Skip to content

Replace/Skip dialog during file transfer no longer takes focus

Rein Fernhout requested to merge Levitating/thunar:focus into master

Fixes #1284

Problem

When during a filetransfer the dialog comes up asking you to replace/skip/cancel it currently takes focus. This is resolved simply by setting focus_on_map to FALSE on that dialog.

However the progress dialog emits a signal to raise itself when this question dialog is opened. In my testing this causes a weird state where the progress dialog seems to have focus but pressing enter causes the button selected in the question dialog to be activated.

The progress dialog is raised with gtk_window_present. 1

Solution

I set the goal of making it impossible to accidentally select an option in the question dialog, while still having the progress dialog be raised.

2024-03-07_13-50

I solved this by setting accept_focus to FALSE on the progress dialog, which I don't think will have other negative side-effects. This is in addition to setting focus_on_map to FALSE on the question dialog.

One could also decide that it is unnecessary to raise the progress dialog as it only clutters the screen and blocks the question dialog which is transient to it.

Further testing

I tested this on i3wm, but the accept_focus configuration is just a hint to the WM. So preferably others should also test this on their own configurations. Simply move a large file from one drive to another, where there is already a file of the same name present. When the question dialog pops up you should not be able to activate a button with your keyboard.

Merge request reports