swaywm / sway

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

No input in focused window #6967

Open jficz opened 2 years ago

jficz commented 2 years ago

Sometimes, when I switch to another workspace, the focused window on that workspace does not receive any input (keyboard or mouse) even though according to the border colors the window should be focused. Switching to another workspace and back usually helps.

I have not found a way to replicate this behavior, it is seemingly random.

Subjectively It is most likely to happen if there is only one window on the "target" workspace but with lesser rate it also happens when there are more. As far as I can tell this only happens with native Wayland windows regardless of what runs in them (Browser, Electron apps, terminal, ...) but I use X11 apps very sparsely so statistically speaking I really can't say anything about XWayland windows.

It is (probably) not related to multi-monitor setup as I've encountered this on all display arrangements I use, including a single laptop screen.

As soon as I find a way to replicate this reliably, I'll post all the requested logs and start playing with the setup.

IlyaMZP commented 2 years ago

I have experienced this when switching away from Telegram window (even though it doesn't use Xwayland), but that also used to happen in i3-wm under X11.

ghost commented 2 years ago

I'm using Fedora 36 and I have also experienced this when using GNOME Terminal, lxpolkit and VSCode (and I can't work without VSCode, and I can't use my system without lxpolkit!).

joanbm commented 2 years ago

I also experience this occasionally on my Fedora 36 setup, but I can't ever recall it ever happening on my Arch setup, which is pretty similar in general. I also can't find a way to consistently reproduce it.

chrisr87 commented 1 year ago

It happens regularly for me, hundreds of times per session. It's almost (I say almost but I can't remember an instance where the keyboard triggered this problem) always when I use the mouse to change the focused window.

jficz commented 1 year ago

interesting, I must say that lately (weeks, maybe a month) I don't actually remember this happening... (I'm on v1.8 currently)

Something else happens though - when I switch workspaces, the window under the mouse cursor does not receive focus until the cursor is moved outside of that window and back. But I guess this is unrelated.

sleroq commented 4 months ago

I can confirm it is still relevant in sway 1.9.0. This is scary because input is still going to last focused window, so you can send/post something by mistake if you quickly switch to other window and press Enter.

equalsraf commented 2 months ago

FWIW I am observing a similar issue - when I open a new window in an empty workspace the window does not get input focus, but if i switch to another workspace and back the windows has input focus.

In my case this seems to be related to the no_focus [tiling] in my config, removing it does fix the issue (unsurprisingly).