Skip to content

Implement proper z-order for xdg surfaces in the kiosk shell

Sergio Gómez requested to merge SergioGDR/weston:fix_xdg_z_order into main

The following patchset implements proper z-order for xdg surfaces in the kiosk shell. For this it introduces to the kiosk shell the concept of a "surface tree": a list of kiosk shell surface structures having a common ancestor (in the xdg protocol sense).

The design is based on the following assumptions that the kiosk shell currently makes:

  • A kiosk surface with no parent must be fullscreen.
  • If a parent is set on a kiosk surface, that surface is assigned the output of the root kiosk surface. This means that all kiosk surfaces in a surface tree will always have the same output.
  • There is no possibility to minimize a kiosk surface.

With these in mind, the following design decisions were deemed convenient:

  • For every output, at most one surface tree list will be active. This means that, for a given output, only views belonging to surfaces of the same surface tree will be in the normal layer. Moreover, all such views will be in the normal layer if the surface tree list is active.
  • The z-order of surface trees (the weston views' relative placement in the normal layer) is determined by the placement of their corresponding kiosk surface in the surface tree list.

Each kiosk shell surface begins its life as root of its own surface tree list. Whenever a parent is set on a surface, that surface is linked to the surface tree list of the root surface of the parent. If a parent kiosk shell surface is destroyed, its children will keep the link to the root surface's surface tree list. If the destroyed parent is also the root surface of the surface tree, each child is unlinked from this root and they become the root of a new surface tree.

Fixes #680 (closed)

Edited by Sergio Gómez

Merge request reports