swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.36k stars 1.09k forks source link

Auto-focus urgent window only works once (tested with Firefox) #7912

Open hakanyi opened 7 months ago

hakanyi commented 7 months ago

Please fill out the following:

martinsolberg commented 6 months ago

Why do you set $focus_on_window_activation focus? Shouldn't it be focus_on_window_activation focus

hakanyi commented 6 months ago

In that case (i.e. without set), automatic activation doesn't work at all, not even once after reloading sway

Wasja7 commented 5 months ago

I can confirm that this bug happens also for other applications. For me it doesn't matter if it is set via focus_on_window_activation focus or set $focus_on_window_activation focus. Every window can gain focus one time, after that it only gets the urgent indicator. After reloading the config it works again for one time. I'm pretty sure this was working in previous versions.

hakanyi commented 5 months ago

Issue (at least wrt to Thunderbird & Firefox as mentioned above) seems to be resolved for sway 1.9. Running kernel 6.6.22-1-MANJARO.

@Wasja7 Can you provide details of your use case?

Wasja7 commented 5 months ago

I've got a file manager on one workspace and a text editor on another. Before this bug I could just hit Enter in the file manager and it would switch focus to the text editor, where the file is opened in a new tab. Now I hit Enter and nothing happens. I have to switch manually to the editor. Same problem with Thunderbird. I use Dunst as notification service. When I get a new message I could just click on the notification and it would focus Thunderbird. Now nothing happens. I'm using Sway 1.9 on Archlinux with kernel 6.7.9

hakanyi commented 5 months ago

Same for me with Thunderbird and mako (notification service): The thunderbird window becomes urgent but doesn't focus. Sth similar for file manager (pcmanfm) and text editor (VSCodium): The only time window activation works is right after reloading sway AND if the file is not already open. Otherwise, the VSCodium window becomes urgent but doesn't focus.

Wasja7 commented 5 months ago

After a bit of research it seems to me this has something to do with #7880

marcelohdez commented 5 months ago

I am experiencing a similar issue after upgrading to Sway 1.9 on Fedora 40 Beta (windows don't seem to auto-focus even once).

Firefox and Vesktop only set themselves as urgent without gaining focus even though I have focus_on_window_activation focus in my config.

They successfully auto-focused in Sway 1.8.1 and still do on my laptop which runs Sway 1.8.1 on Fedora 39 with the same config.