sway icon indicating copy to clipboard operation
sway copied to clipboard

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

Open hakanyi opened this issue 1 year ago • 16 comments

Please fill out the following:

  • Sway Version: 1.8.1

  • Configuration File: Includes set $focus_on_window_activation focus

  • Description: After starting sway, clicking on a URL in thunderbird on workspace A leads to automatic focus on workspace B with firefox. This doesn't work a second time, unless sway is reloaded. Thanks a lot in advance!

hakanyi avatar Jan 18 '24 20:01 hakanyi

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

martinsolberg avatar Feb 27 '24 13:02 martinsolberg

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

hakanyi avatar Feb 27 '24 19:02 hakanyi

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.

Wasja7 avatar Mar 20 '24 19:03 Wasja7

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?

hakanyi avatar Mar 21 '24 18:03 hakanyi

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

Wasja7 avatar Mar 21 '24 18:03 Wasja7

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.

hakanyi avatar Mar 21 '24 18:03 hakanyi

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

Wasja7 avatar Mar 21 '24 19:03 Wasja7

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.

marcelohdez avatar Mar 26 '24 20:03 marcelohdez