Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

Clicks registered at wrong location

Open UltraBlackLinux opened this issue 3 years ago • 9 comments

Hey there, I just noticed a weird issue with waybar. Whenever I click on a custom widget which launches fuzzel, the next few clicks, nomatter where on the bar they happen, will trigger that previous widget for many clicks.

What is causing this?

I'm running Waybar v0.9.16

Thanks!

UltraBlackLinux avatar Jan 22 '23 13:01 UltraBlackLinux

I have the "same" issue. In my case, clicking on a module that launches rofi, makes rofi appear back again wherever on the bar y click after that first time.

Even if I make a killall rofi while the window is showing and it closes.

Waybar v0.9.17 installed through waybar-hyprland-git. Using hyprland.

Here is my config.jsonc extract:

    "battery": {
    	"bat": "BAT0",
	"format": "{icon} {capacity}%",
	"format-icons": ["", "", "", "", ""],
	"on-click": "~/.config/rofi/applets/bin/battery.sh"
    },

At first I thought it had to do with rofi location and anchor values, and their x-offset/y-offset values, that they would interfere with the bar position, since I had it set to "northeast" values, for the top-right section of the screen, where the bar module is.

But even if I set it to the center of the screen, clicking anywhere on the top bar will remain launching that rofi script from anywhere else.

PolGZ avatar Feb 28 '23 17:02 PolGZ

Same here with SwayNC on Hyprland. If I use a different mouse button (right or middle), the bug disappears. I worked around it by adding a sleep in the on-click: "on-click": "sleep 0.1; swaync-client -t -sw". The duration may need to be tweaked. waybar-hyprland-git 0.9.17.r89.gb34d325a-1 (the package only patches the workspace module)

opekope2 avatar Mar 05 '23 18:03 opekope2

Same setup as @opekope2. I noticed that if I right-click twice, the left click on other modules work again.

LDAP avatar Mar 29 '23 11:03 LDAP

I've also noticed this with multiple modules, even the integrated wlr/workspaces, on which the sleep 0.1 workaround doesn't work (or I don't know how to make it work). The issue seems to occur when waybar is defocused, while the user still has the left-mouse button pressed down, so this might also be related to #1047. Even with the sleep added, if you hold down the mouse button, the issue will still occur. As @LDAP mentioned, right clicking does seem to solve this, if that action doesn't also defocus waybar.

Overall, pretty annoying, and I'd love for this to get fixed.

niraami avatar Apr 02 '23 00:04 niraami

Any update on this.?

AnoRebel avatar Aug 01 '23 21:08 AnoRebel

tehre is a similar thread over on the hyprland issue tracker and there are two ways to work around this:

  1. gamemoderun <command>
  2. sleep <some time, can be short>; <command>

UltraBlackLinux avatar Aug 01 '23 22:08 UltraBlackLinux

You should be able to fix it by opening swaync when click is released
"on-click-released": "swaync-client -t -sw"

KosmX avatar Aug 14 '23 10:08 KosmX

You should be able to fix it by opening swaync when click is released "on-click-released": "swaync-client -t -sw"

I still need to add the sleep 0.1 and "on-click-released" doesn't make any change in the behaviour. The clicks are still locked.

My waybar version: waybar-git r3034.0a747dda-1

kurtnettle avatar Nov 22 '23 14:11 kurtnettle

Just keeping the thread hot. I'm also still having this issue with waybar 0.9.24-2 (with hyprland)

UPDATE: It appears, in my case, the issue was limited to the script that launched wofi. Changing to "on-click-release" for that command only was sufficient to make the issue go away.

joekm avatar Jan 23 '24 00:01 joekm

sleep 0.1; and "on-click-realsesed" only work for mouse click's but it isn't working for touchpad. Any solution for "Touchpad".

Ankur97444 avatar Mar 07 '24 06:03 Ankur97444

I had this issue when switching workspaces with a click. Upgrading to latest version of hyprland git fixed the problem for me

tomben13 avatar Mar 10 '24 07:03 tomben13