Skip to content

Draft: xdg-shell: track init state, remove auto configures, improve events

Kirill Primak requested to merge vyivel/wlroots:xdg-shell-another-rework into master

Overview

  • xdg_surface is now treated as a wl_surface role object.
  • xdg_surface initialization state is now tracked correctly.
  • xdg_surface isn't configured automatically anymore.
    • An exception to this is xdg_popup_handle_reposition(). This will be fixed later.
  • Events are now emitted at the proper time.

Breaking changes

  • wlr_xdg_shell.events.new_surface is now emitted when an xdg_surface is created. To track when an xdg_surface role object is created, use wlr_xdg_shell.events.new_{toplevel,popup}.
    • The new events are emitted when a corresponding role object is created. If you need to configure a newly created xdg_surface, set up a surface commit handler and wait until wlr_xdg_surface.initial_commit is true.
  • wlr_xdg_surface.events.destroy is now emitted when the xdg_surface is destroyed. To track when the xdg_surface role object is destroyed, use wlr_xdg_{toplevel,popup}.events.destroy.
  • wlr_xdg_decoration_manager_v1.events.new_toplevel_decoration is now always emitted when a zxdg_toplevel_decoration_v1 is created.
  • It is now forbidden to schedule a configure for an uninitialized xdg_surface.

Other

  • With this MR, creating multiple xdg_surface objects for the same wl_surface, as well as creating xdg_surface and then¹ e.g. wl_subsurface for the same wl_surface is disallowed, but there's no reason to support this.

¹The reverse order is explicitly prohibited by the xdg-shell protocol.


Sway patch: https://github.com/swaywm/sway/pull/7662

Edited by Kirill Primak

Merge request reports

Loading