swaywm / sway

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

swaybar: scroll events are sometimes sent to swaybar even if it is hidden #5002

Open hhirtz opened 4 years ago

hhirtz commented 4 years ago

Hi,

Sometimes, when the cursor is where swaybar should be when it's not hidden, scrolling changes the workspace (instead of moving the content of the focused window).

I think the required configuration should be:

cf. at the end of the report for a configuration file that fulfill these requirements.

Example steps to reproduce (see debug log):

Expected behavior: nothing happens Actual behavior: sway moves to the second workspace, the one with the window open

Sway Version: 1.4 Debug Log: https://gist.github.com/hhirtz/7bcfa30b72186943203cfe6044cb77b3#file-sway-log Configuration File: https://gist.github.com/hhirtz/7bcfa30b72186943203cfe6044cb77b3#file-config-txt

ianyfan commented 4 years ago

This is even easier to reproduce: just move the cursor where the bar would appear, press the modifier so that the bar shows briefly and then hides, then scroll.

ianyfan commented 4 years ago

So the issue seems to be more general: if the layer shells are arranged such that the surface under the pointer changes, i.e. a layer shell appears under the pointer or disappears from under the pointer, sway doesn't update the pointer focus. This does seem to be counter-intuitive, but I don't know what would be the sanest behaviour, and I'm not sure where the appropriate fix would be, maybe in arrange_layers?

emersion commented 4 years ago

Yeah, we should rebase the cursor when the layer surfaces layout changes. A more general solution would be to make layer shell use the atomic layout infrastructure.