Draft: xdg-shell: track init state, remove auto configures, improve events
- Fixes #3677 (closed)
- Fixes #3567 (closed)
- Fixes #3662 (closed)
- Fixes #2543 (closed)
- Supersedes !3985 (closed)
- Addresses #3608 (closed)
Overview
-
xdg_surface
is now treated as awl_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.
- An exception to this is
- Events are now emitted at the proper time.
Breaking changes
-
wlr_xdg_shell.events.new_surface
is now emitted when anxdg_surface
is created. To track when anxdg_surface
role object is created, usewlr_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 untilwlr_xdg_surface.initial_commit
istrue
.
- The new events are emitted when a corresponding role object is created. If you need to configure a newly created
-
wlr_xdg_surface.events.destroy
is now emitted when thexdg_surface
is destroyed. To track when thexdg_surface
role object is destroyed, usewlr_xdg_{toplevel,popup}.events.destroy
. -
wlr_xdg_decoration_manager_v1.events.new_toplevel_decoration
is now always emitted when azxdg_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 samewl_surface
, as well as creatingxdg_surface
and then¹ e.g.wl_subsurface
for the samewl_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