Skip to content

xdg-popup

Simon Ser requested to merge github/fork/acrisci/feature/xdg-popup into master

Created by: acrisci

Xdg popups are meant for user interface elements (mostly for menus I guess). They are similar to subsurfaces, but not related.

Popups must have a parent surface which can be a toplevel or another popup which gives them a tree structure. This structure determines the z-order of the popup, and the protocol forbids destroying popups that are not leaves.

Popups are created with a "positioner" that hints on how the popup should be positioned. This positioner is used only once when the popup is created and will then be destroyed by the client.

Popups can "grab" the seat. When a popup has a grab, it has keyboard focus. The client who has the grab will get events on their surfaces as normal, but no other client should get seat events until the grab is broken. The grab is broken when the popup is dismissed, or there is a button event outside of the popup and none of the child popups have a grab (I think). At that time the popup is closed.

Examples of xdg-popup:

  • weston-flower right click menu (the simplest example)
  • gnome-terminal menu bar menus (nested example)
  • gnome-calculator has various menus

TODO:

  • cancel grab
  • popup keyboard grab
  • popup pointer grab
  • popup input events
  • render popups in the right position
  • popup tree data structures in the view

Merge request reports