Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyprland with on-click causes weird behavior #1850

Open
SeanMcnabb opened this issue Nov 29, 2022 · 28 comments
Open

Hyprland with on-click causes weird behavior #1850

SeanMcnabb opened this issue Nov 29, 2022 · 28 comments

Comments

@SeanMcnabb
Copy link

I have a custom module that launches rofi when clicked. In sway it works normally but causes some weird problems in Hyprland. After clicking on the module, it will show rofi normally, but if you click anywhere on waybar after that, it will act as if you clicked the module again and either show rofi again, or attempt to. It will stop if you right click the waybar before clicking it again. It doesn't happen with every application. For instance, I was able to get this to happen when launching rofi or kwrite, but launching wofi or alacritty, the behavior is as expected.

My workaround for now is to launch rofi with gamemoderun which prevents this from happening.

@SeanMcnabb
Copy link
Author

SeanMcnabb commented Nov 30, 2022

The following PR fixes the issue for on-click events #1784

However, it still happens with system tray icons with the same behavior

@SeanMcnabb
Copy link
Author

So after some further testing, the above PR is only a partial fix. It will prevent the application from launching another instance after clicking anywhere on the waybar, but the waybar won't register any input until you click on it a second time. So after clicking a button with "on-click" and launching rofi or some other programs, it will then require you to click anywhere on the waybar or else it won't accept any input such as scrolling or other clicks

@justinsandhu
Copy link

Im seeing the same behavior with an on-click script that is running a swaymsg command. @SeanMcnabb what are you trying to run?

@nova-nowiz
Copy link
Contributor

I'm having the exact same issue @SeanMcnabb!
@justinsandhu, it basically happens with everything, every tray icon action is broken, and same thing with on-click events on modules (for example launching pavucontrol)
Should we ping someone for this issue?

@rubyowo
Copy link

rubyowo commented Dec 16, 2022

I'm facing this problem aswell. Clicking on any module with on-click will make its action repeat if you click again, the only way i can stop it is to right click on any tray icon, also tray icons and their actions work perfectly for me.

@nova-nowiz
Copy link
Contributor

Yes, if you right rick each time before left clicking, it works, should we ping alexays?
I don't know where that would come from since it affects the whole bar on Hyprland
@justinsandhu were you on sway? if that's the case, do you still encounter the issue?

@k1gen
Copy link

k1gen commented Dec 18, 2022

I have the same weird behavior as @rubyowo on hyprland-git and waybar-hyprland-git on Arch

@nova-nowiz
Copy link
Contributor

nova-nowiz commented Dec 19, 2022

Oh, so that's a problem on all wlroots' based compositors maybe?
In that case @SeanMcnabb, could you update the title to reflect this?

I misread, sorry about this, but if someone has sway, it would be great to test waybar there.

@mrbman
Copy link

mrbman commented Dec 22, 2022

I have the same behavior. Tried on both waybar-hyprland-git and waybar-hyprland on Arch

@rubyowo
Copy link

rubyowo commented Dec 25, 2022

@Narice Just confirmed. This issue is hyprland only.

@nova-nowiz
Copy link
Contributor

@rubyowo thanks! that's really useful, I'll try some stuff to see if the issue is coming from waybar or Hyprland.

@riley-martin
Copy link

riley-martin commented Jan 3, 2023

I am also using hyprland-git and waybar-hyprland-git and have this problem as well. Also after I click on something, the tooltips do not show until I right-click somewhere in the bar.

@abhakta-47
Copy link

I looked into the issue. It looks like Task::handle_button_release(GdkEventButton *bt) in src/modules/wlr/taskbar.cpp is not immediately called after mouse button is released in Hyprland. So, it acts like mouse button is still clicked. Not sure if the underlying issue is with hyprland or waybar.

@mrbman
Copy link

mrbman commented Jan 9, 2023

I tested with EWW's onclick function (not running waybar) on Hyprland and I get the same issue, where once I've clicked anything on the EWW bar the same action happens for every subsequent click.

Also tested both EWW and Waybar on Sway and both work fine, and do not show this issue, thus seems to be an issue with Hyperland. Running hyprland-git and waybar-hyprland-git FYI.

@Rydgel
Copy link

Rydgel commented Jan 9, 2023

Weird I don't have the issue, hyprland-git and waybar-hyprland-git. The on-click actions I have is muting/unmuting microphone, muting/unmuting speaker and switching workspaces. Systray and hover popups works fine as well.

@Aleksanaa
Copy link

Weird I don't have the issue, hyprland-git and waybar-hyprland-git. The on-click actions I have is muting/unmuting microphone, muting/unmuting speaker and switching workspaces. Systray and hover popups works fine as well.

That of course doesn't cause the problem. Try setting "on-click" to launch a gui program instead.

@Stetsed
Copy link

Stetsed commented Jan 21, 2023

Experiencing this issue aswell on hyprland-git and waybar-hyprland-git. The onclick actions launch rofi menus but then it keeps launching that rofi menu when trying to do anything that involves clicking on the waybar

@Wakatron
Copy link

Wakatron commented Feb 5, 2023

I am also using hyprland-git and waybar-hyprland-git and have this problem as well.

@Aleksanaa
Copy link

I am also using hyprland-git and waybar-hyprland-git and have this problem as well.

Hey, please refer this issue hyprwm/Hyprland#1348. The developers seems to have no idea how to solve the issue.

@PROxZIMA
Copy link

My workaround for now is to launch rofi with gamemoderun which prevents this from happening.

The launch delay is just HUGE. Any recommended settings to launch rofi/tofi quickly using gamemoderun?

@SeanMcnabb
Copy link
Author

My workaround for now is to launch rofi with gamemoderun which prevents this from happening.

The launch delay is just HUGE. Any recommended settings to launch rofi/tofi quickly using gamemoderun?

For me the delay is only like .25 seconds or something, it's pretty low. I'm not sure what the difference would be.

@ShabirK21
Copy link

I have a custom module that launches rofi when clicked. In sway it works normally but causes some weird problems in Hyprland. After clicking on the module, it will show rofi normally, but if you click anywhere on waybar after that, it will act as if you clicked the module again and either show rofi again, or attempt to. It will stop if you right click the waybar before clicking it again. It doesn't happen with every application. For instance, I was able to get this to happen when launching rofi or kwrite, but launching wofi or alacritty, the behavior is as expected.

My workaround for now is to launch rofi with gamemoderun which prevents this from happening.

does gamemoderun still work for you? it worked previously for me but doesnt now

@zenmaster3000
Copy link

In case some one here is not informed.

The current work around appears to be adding some delay to the launching of the application. See this thread

Simply adding:

sleep 0.1 && ...

before calling your application should fix the issue.

@aryklein
Copy link

In case some one here is not informed.

The current work around appears to be adding some delay to the launching of the application. See this thread

Simply adding:

sleep 0.1 && ...

before calling your application should fix the issue.

Thanks, that helped me

@cjuniorfox
Copy link

Same here. Fedora 38 with solopasha/hyprland Copr. Adding "gamemoderun" or some delay works around the issue

cjuniorfox added a commit to cjuniorfox/dotfiles that referenced this issue Jul 23, 2023
K0SS4 pushed a commit to K0SS4/.dotfiles that referenced this issue Nov 3, 2023
@ipg0
Copy link

ipg0 commented Nov 13, 2023

@osalas88 thanks a lot, helped me.

abmantis added a commit to abmantis/hypr.dotfiles that referenced this issue Jan 2, 2024
Serpentian added a commit to Serpentian/AlfheimOS that referenced this issue Jan 7, 2024
Waiting for Alexays/Waybar#1850 to be fixed. Workaround is ok.
42Willow added a commit to 42Willow/dotfiles that referenced this issue Jan 25, 2024
@LoneWolf4713
Copy link

Hi this bug still persists as of Feb 2024, and no 0.1 delay doesn't work for me. clicking on waybar after opening whatever dialog works

@stevekanger
Copy link

stevekanger commented May 3, 2024

Is there any more news on this? It's now May 2024. I am having the same issue. I'm on sway not hyprland. I switched to waybar after just using the sways built in bar for ever. I made some custom launchers and if I click on custom launcher and then click anywhere on waybar the same click action keeps happening. The only way to get it to stop is to then right click anywhere on waybar. I can get it to stop if I add sleep 0.3 before the command. Not an ideal solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests