Open bagnaram opened 3 years ago
Waybar shouldn't be affected by focus_follows_mouse
since it is on the Layer Shell.
However I can partially reproduce the bug on Waybar v0.9.5-109-gb1dd620
.
If there is a full-screen application in a workspace and you switch to that workspace by clicking on the button in the sway/workspaces
module, then next time you want to switch to a workspace you have to click waybar twice, once to "refocus" it and a second time to switch to the workspace.
So this happens only if the first destination workspace contains a fullscreen window.
I figured out this behavior occurs when I set mouse_warping container
When switching workspaces, the mouse warps to the selected container and somehow makes waybar lose focus and requires one click to "re-focus" it and an additional click if I want to switch workspaces or interact with any other modules.
Video uploaded to demonstrate the issue. https://youtu.be/DcFglic3gXo
Maybe will be fixed in https://github.com/Alexays/Waybar/pull/1120
Unfortunately no. I'm on #1120 and just tried setting mouse_warping container
reproducing your issue.
I remembered observing something similar during development in #1120. When moving the cursor away from Waybar whilst pressing it, a click was required to regain focus.
This is also what is causing this issue. When the button_pressed
event is triggered it immediately shifts focus to the other container. The button cannot finish its business. One solution would be in pinselimo@1f1b911 to use the button_clicked
event. However, then the action will only be performed once the user releases the button.
I'll have to take a closer look at #1120 if it contains a better solution.
Turns out this is a bigger problem. If a module loses pointer focus whilst being pressed, it doesn't receive the release event. Another click anywhere in the bar will trigger another press event on the previously pressed module (Possibly described in #1107 ).
To reproduce set mouse_warping container
in your sway config. Then, ...
... using modules: Click a module launching a window and keep the mouse button pressed until the pointer focuses the newly opened window. Release it and close the window. Click anywhere in the Waybar and the window will open again.
... using sway/workspaces: Click to change the workspace. Hover over the workspace buttons, no animations will appear. Change the workspace with your keyboard. Only the previously clicked workspace button will react if hovered.
I've tried a lot of stuff including listening to leave_notify
events. Those were also triggered again on click anywhere in the bar.
The simplest solution is still to trigger events only once a Button/Module is released. @Alexays should I post a PR using button releases or is this no viable option for you?
This is the simple symptom I am seeing. Although I am not sure how it directly relates to the click release focus.
focus_follows_mouse = always
Click on non-selected sway/workspace item. Waybar obtains "focus". Click sway/workspace item again to actually register workspace change event. Mouse relocates to new window in workspace and waybar loses "focus"
Hi @bagnaram, does https://github.com/swaywm/sway/pull/6418 solve your issue?
Hi @pinselimo . I will test this out when I have a good chunk of time to set up a sway/wlroots build environment. I want to build without pulling in all the xorg dependencies on my machine si I might go the submodule build approach.
I haven't forgot about this! Life has been kind of busy lately but I hope to have this tested soon
I just tested against the latest master
and the mentioned issue remains.
@pinselimo Would you like me to test this with the button_releases event PR?
Can you reference the PR, I've skimmed recent PRs and couldn't figure out which one you mean ? :)
I was referring to the unimplemented test: "I've tried a lot of stuff including listening to leave_notify events. Those were also triggered again on click anywhere in the bar. The simplest solution is still to trigger events only once a Button/Module is released. @Alexays should I post a PR using button releases or is this no viable option for you?"
Configuration: I set
focus_follows_mouse = always
in Sway and activated Waybar.The trouble is when I switch workspaces, I am not able to hover over a button inside of waybar without "clicking to focus" waybar. This means I have to make two mouse clicks on a waybar button in order for it to respond, after switching workspaces.