8000 fix(menus): open right-click menus on the button's release on X11 by fsoft72 · Pull Request #427 · hyprlab/hylki · GitHub
[go: up one dir, main page]

Skip to content

fix(menus): open right-click menus on the button's release on X11 - #427

Closed
fsoft72 wants to merge 1 commit into
hyprlab:mainfrom
fsoft72:fix/x11-context-menus
Closed

fsoft72 wants to merge 1 commit into
hyprlab:mainfrom
fsoft72:fix/x11-context-menus

Conversation

@fsoft72
@fsoft72 fsoft72 commented Oct 12, 2026
Copy link
Copy Markdown
Contributor

What

On an X11 session no right-click menu works: clicking any entry only closes the menu and the action never runs. Wayland is not affected.

Why

Context menus pop up on the right-button press. On X11 the release that follows ends the press's implicit grab, and that breaks the grab the popover has just taken: GTK logs Broken accounting of active state for the menu's widgets, then the popover receives a GrabBroken. The menu stays on screen, but the next click never reaches it, so autohide closes it and no button emits clicked.

How

  • src/ui/context_menu.rs: new popup_after_release(), used by show_context_menu_popover() instead of popover.popup().
  • On X11, when a mouse button is still held, a capture-phase EventControllerLegacy on the window waits for the release, then pops the menu up (on idle) and removes itself.
  • The button state comes from surface.device_position(): the pointer device's own modifier_state() always reads empty on X11, which would never defer anything.
  • Wayland, and menus opened without a held button (toolbar buttons, keyboard), still pop up at once.
  • CHANGELOG.md: one entry.

The fix is in the shared menu builder, so every context menu benefits (message list, reader, sidebar, compose, attachments, contacts).

Testing

  • cargo build.
  • By hand on X11 (GTK 4.20.1): right-click a message in the list, pick an entry, and the action runs. Before the fix the log showed the right-button release reaching the popover and then a GrabBroken. After the fix it shows the button seen as held (BUTTON3_MASK) and no Broken accounting warnings.
  • Not tried by hand: the other menus (they share the same code path) and Wayland (code path unchanged).

On X11 the right-click release that follows the press ended the press's
implicit grab and broke the grab the popover had just taken: the menu
stayed up but no click reached it, so every entry only closed it. When a
button is still held, the popover now pops up once it is released. The
pointer's own modifier state reads empty on X11, so the button state is
asked from the window's surface instead.
hyprlab added a commit that referenced this pull request Oct 12, 2026
On X11 the right-button release broke the popover's grab, so no menu entry ever acted. Wayland keeps opening the menu on the press.

Co-Authored-By: Fabio Rotondo <2844375+fsoft72@users.noreply.github.com>
@hyprlab
hyprlab commented Oct 14, 2026
Copy link
Copy Markdown
Owner

Agentic reply:

Your fix is in the 1.44.0-beta.7 release (x86_64 only), as you submitted it. Please test it there and report anything that doesn't look right. It reaches the stable channel with the next stable release.

The beta build is in the repo now: flatpak update picks it up.

@hyprlab hyprlab closed this Oct 14, 2026
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

Successfully merging this pull request may close these issues.

2 participants

0