Skip to content

Fix indicator popovers failing to open from keybindings on Wayland - #737

Open
mehdip2007 wants to merge 1 commit into
elementary:mainfrom
mehdip2007:fix-popovers-wayland
Open

mehdip2007 wants to merge 1 commit into
elementary:mainfrom
mehdip2007:fix-popovers-wayland

Conversation

@mehdip2007

Copy link
Copy Markdown

Fixes #726

Problem

On Wayland, indicator popovers — including the Applications Menu — fail to open when triggered from a keybinding (e.g. the Super accelerator via org.gnome.Shell / D-Bus activation). Clicking an indicator works, but exactly one keyboard-triggered open succeeds after every click. After enough open/close cycles the popover can also end up visible but never drawn, and the panel eventually dies with a Wayland protocol error.

Causes

  • xdg_popup grab: the popover was created with autohide = true, which makes GTK request an xdg_popup grab. Wayland only grants that grab against a recent input event serial, and a popover opened from a keybinding has received no input at all — so the compositor refuses the popup and it is never mapped. Clicking an indicator supplies a serial, which is why one keyboard-triggered open succeeded after every click.
  • Reparenting on every cycle: unparent () + set_parent () on every open/close destroys and recreates the popover surface, eventually leaving it visible but unmapped and ending in a Wayland protocol error.
  • get_panel () requested twice: realize can fire more than once; a second get_panel () request on the same surface makes the compositor terminate the client with a protocol error, taking the whole panel down.
  • No keyboard focus: panels are never focused automatically by the compositor, so typing in the Applications Menu search field never reached the popover.

Changes

  • PopoverManager: create the popover with autohide = false and dismiss it when the panel toplevel loses keyboard focus (PopoverManager.close ()), instead of relying on the grab.
  • PopoverManager: only reparent the popover when it actually moves to a different indicator, and don't unparent on close.
  • PanelWindow: guard get_panel () against a second request and make realize handling run only once.
  • PanelWindow: request keyboard focus when a popover opens, with a Wayland roundtrip so the popup is created after focus is actually granted — without this, typing in the Applications Menu search field does not work.

Testing

Built and tested on Wayland: the Applications Menu now opens reliably from the Super key every time (not just once after each click), the search field accepts typing, and repeated open/close cycles across indicators no longer produce an unmapped popover or protocol errors.

Forward-port of ae9b6d6 (branch fix-indicator-popovers-wayland, based on
r794) to the current PopoverManager rewrite:

- The popover is created with autohide disabled: GTK's autohide requests an
  xdg_popup grab, and Wayland only grants that grab against a recent input
  event serial. A popover opened from a keybinding (org.gnome.Shell
  accelerator activation / D-Bus activation) has received no input, so the
  compositor refuses the popup and it is never mapped. Clicking an
  indicator supplies a serial, which is why exactly one keyboard-triggered
  open succeeded after every click. Dismissal now happens when the panel
  toplevel loses keyboard focus (PopoverManager.close ()).
- The popover is only reparented when it actually moves to a different
  indicator. Unparent+set_parent on every cycle destroys and recreates the
  popover surface, eventually leaving it visible but unmapped and ending in
  a Wayland protocol error.
- get_panel () is guarded against a second request, which the compositor
  answers by terminating the client, and realize handling runs only once.
- Keyboard focus is requested when a popover opens (panels are never
  focused automatically), with a roundtrip so the popup is created after
  focus is actually granted; without this, typing in the Applications Menu
  search field does not work.
@lenemter
lenemter requested review from a team and lenemter October 3, 2026 10:57
@danirabbit

Copy link
Copy Markdown
Member

Thanks for your submission! Can you confirm that you did not use LLMs in accordance with our contributor guidelines? https://docs.elementary.io/contributor-guide/development/generative-ai-policy

@lenemter
lenemter removed request for a team and lenemter October 11, 2026 16:30
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.

Pressing Super keyboard shortcut to open Applications Menu again make it unrespond

2 participants