Jas-SinghFSU / HyprPanel

A Bar/Panel for Hyprland with extensive customizability.
448 stars 32 forks source link

Widgets become unresponsive and Keyboard loses focus after two clicks #91

Open Shubham-550 opened 1 month ago

Shubham-550 commented 1 month ago

Describe the bug

After two left mouse button (LMB) clicks on the widgets:

  1. The widgets do not respond to subsequent LMB clicks when the mouse does not move.
  2. The keyboard loses focus of the window even after clicking on it.

To Reproduce

  1. Click on any widget more than twice without moving the mouse; the widgets will stop responding.
  2. Click on any widget more than twice and then switch to another window; the keyboard will not work.

Expected behavior Widgets should respond to all left mouse button (LMB) clicks, regardless of mouse movement. Additionally, the keyboard should retain focus on the window after clicking on it.

Desktop (please complete the following information):

Additional context RMB do not have this problem.

matavach commented 1 month ago

I actually had a similar issue before Are you using any virtual input services (ydotool) etc? Do you have any hyprland keybinds with "bindl"

I found those to be the cause of my issue.

Jas-SinghFSU commented 1 month ago

Is there a specific widget causing this? I can't seem to replicate it give your steps to reproduce. I see that the menus don't close if you don't move your mouse however.

Shubham-550 commented 1 month ago

I actually had a similar issue before Are you using any virtual input services (ydotool) etc? Do you have any hyprland keybinds with "bindl"

I found those to be the cause of my issue.

I found xdotool but deleting it and after restarting still issue is there. I don't know anything about those services. There is no bindl keybind in the config.

Is there a specific widget causing this? I can't seem to replicate it give your steps to reproduce. I see that the menus don't close if you don't move your mouse however.

It is happening on all the widgets.

In the attached video, the cursor was blinking but after two clicks on the widget the cursor blinking stop.

https://github.com/user-attachments/assets/b5960a38-b30f-4b4c-b71b-6afbc653fd96

Jas-SinghFSU commented 1 month ago

Hmm, the menu that is spawned when you click a module listens to keypress events, which is probably why you're losing focus; it's listening for input - 'escape' specifically to close the menu. My question is, when you click back on the window, does it restore the focus? Are you saying that you don't want the focus to get lost when clicking menus or that the focus can't be regained once lost?

If it's the former then that's an easy fix: we implement the ability to disable key press events for menus. If it's the latter then I'll need some more info since I can't seem to replicate this behavior with the same steps you did in the video.

Shubham-550 commented 1 month ago

when you click back on the window, does it restore the focus?

No for keyboard Yes for mouse

Are you saying that you don't want the focus to get lost when clicking menus or that the focus can't be regained once lost?

Focus can't be regained unless I move the window or mouse crosses to another window and move back.

Jas-SinghFSU commented 1 month ago

Could you checkout branch menu_layer and try 2 things:

  1. See if the issue still persists (I've changed the layer from 'top' to 'overlay' for menus)
  2. Go to Settings > Configuration > General and Disable 'Escape To Close Menus' and see if it still persists
Shubham-550 commented 1 month ago

Could you checkout branch menu_layer and try 2 things:

1. See if the issue still persists (I've changed the layer from 'top' to 'overlay' for menus)

2. Go to Settings > Configuration > General and Disable 'Escape To Close Menus' and see if it still persists

This works.

I see that the menus don't close if you don't move your mouse however.

This is happening in this branch.

Can you also make widgets open menu after more than 2 clicks.

Jas-SinghFSU commented 1 month ago

Did the branch work out of the box or did step 2 make it work for you?

As for the clicks not registering if mouse doesn't move at least one pixel, it seems that it's either an AGS or GTK issue :(. I'll have to dig in to find out which ones the culprit and open a issue.

Shubham-550 commented 1 month ago

Step 2 make it work.

Jas-SinghFSU commented 1 month ago

With step 1 only is the behavior 100% the same? Also would it be possible for you to share your hyprland config?

Shubham-550 commented 1 month ago

With step 1 only is the behavior 100% the same?

yes

Also would it be possible for you to share your hyprland config?

yes. I will edit it in few mins for the github config link

https://github.com/Shubham-550/ML4W-dotfiles-local

Jas-SinghFSU commented 1 month ago

I was able to pull your configuration into my environment but can't seem to replicate the issue. The moment I close the menu, I can bring focus right back to the window with no issues. I'd be curious to know if anyone else who is having this issue could comment as well.

Jas-SinghFSU commented 3 weeks ago

@Shubham-550 Is this still an issue for you? I'm still trying to find a way to replicate it, haven't forgotten about this.

Shubham-550 commented 3 weeks ago

As for the clicks not registering if mouse doesn't move at least one pixel, it seems that it's either an AGS or GTK issue :(. I'll have to dig in to find out which ones the culprit and open a issue.

Did you find a solution regarding this?

And second issue is resolved. Thank you.

Jas-SinghFSU commented 3 weeks ago

Did you find a solution regarding this?

Unfortunately not :( Seems like some Gtk funkiness when it comes to event boxes. I'll keep a lookout for a fix.

Are you using my custom branch for your fix to the second issue or is master branch working fine for you now?

Shubham-550 commented 3 weeks ago

I am using menu_layer branch.

Jas-SinghFSU commented 3 weeks ago

Gotcha, issue there is that since no key press events are passed through, you can't enter your wifi password :(

smathles commented 3 weeks ago

I'm also experiencing this issue. On mouse hover over any widget it changes colour (focused on that widget), click (opens widget menu, colour changes back [indicating focus lost?]), click again (close widget menu), don't move mouse a single pixel and click again (no result, as the colour/focus was lost in after first click).

Could be an ags issue, I've got no idea. Might just be useful to add my experience + 2 cents.

Jas-SinghFSU commented 3 weeks ago

This apparently is related to AGS and Hyprland. Few people have reported that they see the same behavior (outside of Hyprpanel) with their AGS configs but not on other Compositors.

I'll keep a lookout for news on this.