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

Menus only close by mouse clicking a GTK area. #98

Closed
01micko opened this issue Jun 8, 2023 · 3 comments
Closed

Menus only close by mouse clicking a GTK area. #98

01micko opened this issue Jun 8, 2023 · 3 comments

Comments

@01micko
Copy link
Contributor

01micko commented Jun 8, 2023

I realise this is the same with all GTK applications. If you open a menu and choose not to click the menu entry then to close you must click in any GTK area for the menu to close.

ATM, I'm using left click on desktop to close the menu by killall -HUP sfwbar in my labwc/rc.xml config file by mouse bind. A snippet:

   <context name="Root">
      <mousebind button="Left" action="Press">
        <action name="Execute"><command>killall -HUP sfwbar</command></action>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="ShowMenu" menu="root-menu"/>
      </mousebind>
      <mousebind button="Middle" action="Press">
        <action name="ShowMenu" menu="none"/>
      </mousebind>
      <mousebind direction="Up" action="Scroll">
        <action name="GoToDesktop" to="left" wrap="yes"/>
      </mousebind>
      <mousebind direction="Down" action="Scroll">
        <action name="GoToDesktop" to="right" wrap="yes"/>
      </mousebind>
     </context>

This approach is a little harsh because we are restarting the bar just to close a menu!

Is there another way?

Thanks!

@LBCrion
Copy link
Owner

LBCrion commented Jun 8, 2023

This seems to be a compositor specific behavior. I just tested this and on sway and hyprland, the menu closes if I click outside of the bar, but on labwc it doesn't. I suspect some event is sent by sway but not by labwc?

@01micko
Copy link
Contributor Author

01micko commented Jun 8, 2023

Thanks for testing. I'll raise an issue on labwc and close this. I'd better update labwc!

@01micko 01micko closed this as completed Jun 8, 2023
@Consolatis
Copy link
Contributor

Pretty sure its a labwc bug, it seems we are not resetting the keyboard focus on desktop click. Instead, it requires a click on another surface to reset the keyboard focus and thus close the context menu.

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

3 participants