Commit Graph

21 Commits

Author SHA1 Message Date
Kirill Primak 0e2d369106 xdg-surface: simplify configure mechanism
This commit removes any checks whether a configure will change anything
and makes configures be sent unconditionally. Additionally, configures
are scheduled on xdg_toplevel.{un,}set_{maximized,fullscreen} events.
2021-09-21 10:09:09 +02:00
Kirill Primak b72a217fcc xdg-toplevel: refactor configure/state flow
Previously, `wlr_xdg_toplevel` didn't follow the usual "current state +
pending state" pattern and instead had confusingly named
`client_pending` and `server_pending`. This commit removes them, and
instead introduces `wlr_xdg_toplevel.scheduled` to store the properties
that are yet to be sent to a client, and `wlr_xdg_toplevel.requested`
to store the properties that a client has requested. They have different
types to emphasize that they aren't actual states.
2021-09-21 10:09:09 +02:00
Ilia Bozhinov 42d033e738 xdg-shell: add wlr_xdg_toplevel_set_parent
Co-authored-by: Jason Francis <cycl0ps@tuta.io>
2021-01-05 20:32:56 +01:00
Isaac Freund 2072d59da5 xdg-shell: split last-acked and current state
These states are distinct in the time period between the ack_configure
and the next commit on the surface. Splitting these states avoids the
following race for example:

- client starts at 1000x1000
- wlr_xdg_toplevel_set_size 500x500
- size is different -> configure sent
- client acks the configure
- wlr_xdg_toplevel_set_size 1000x1000
- compare_xdg_toplevel_state returns true since there is no pending
  configure and the currently committed size is still 1000x1000
- no new configure is sent
- client commits at the size it last acked, 500x500
2020-08-27 12:36:29 +02:00
Brian Ashworth 9914784594 wlr_xdg_toplevel: reparent on parent unmap
From the xdg-shell specification:
	If the parent is unmapped then its children are managed as
	though the parent of the now-unmapped parent has become the
	parent of this surface. If no parent exists for the now-unmapped
	parent then the children are managed as though they have no
	parent surface.
2019-08-15 11:19:06 +03:00
Brian Ashworth 4e614683b7 wlr_xdg_toplevel: store pending fullscreen output
Since the fullscreen request may be made before the toplevel's surface
is mapped, the requested fullscreen output needs to be stored so it
can be retrieved on map (along with the existing fullscreen property).

This commit makes the required changes for wlr_xdg_toplevel.
2019-03-27 10:04:10 +02:00
emersion 5515faa197
xdg-shell: emit xdg_surface destroy when role object is destroyed
Fixes https://github.com/swaywm/wlroots/issues/1407
2018-12-04 13:42:29 +01:00
emersion 95dfbe2962
xdg-shell: don't destroy xdg role state on role destroy
ie. don't destroy surface->toplevel on xdg_toplevel destroy. Instead do this on
xdg_surface destroy.

This allows compositors to add toplevel listeners when the surface appears and
remove them when the surface is destroyed.
2018-11-12 19:37:22 +01:00
Drew DeVault 5642c5cc8f
Merge pull request #1053 from emersion/xdg-decoration
Add xdg-decoration-unstable-v1 support
2018-08-02 09:33:10 -04:00
emersion 555721f714 Add xdg-decoration-unstable-v1 support 2018-07-28 22:48:07 +01:00
Drew DeVault f1b65b34a6
Merge pull request #1127 from emersion/surface-precommit
surface: add wlr_surface_role.precommit
2018-07-27 13:21:03 -04:00
Ilia Bozhinov 8b7c85d765 xdg-shell(-v6): add set_title and set_app_id toplevel signals
This is useful for example when rendering decorations
2018-07-22 22:42:37 +03:00
emersion 16d7e09d99 surface: add wlr_surface_role.precommit
This allows to emit the unmap event before the surface becomes
actually unmapped for most shells.
2018-07-15 19:30:19 +01:00
Drew DeVault c0b4217fce
Merge pull request #1116 from emersion/surface-role
surface: replace wlr_surface_set_role_committed with wlr_surface_role
2018-07-11 15:27:42 -07:00
emersion 7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
emersion 33db4263a0
surface: replace wlr_surface_set_role_committed with wlr_surface_role 2018-07-07 22:45:16 +01:00
emersion 3c0d672ebd
surface: make pending and current embedded structs 2018-07-04 19:12:17 +01:00
emersion a59774f364
xdg-shell{,-v6}: fix compare_xdg_surface_toplevel_state 2018-06-20 21:25:01 +01:00
Ilia Bozhinov a989104a6b xdg-shells: add a set_parent signal to toplevel surfaces 2018-06-06 17:08:06 +03:00
emersion 47f097e09b
xdg-shell: add wlr_xdg_toplevel_set_tiled 2018-05-27 13:38:06 +01:00
emersion 3036507463
xdg-shell: split into multiple files 2018-05-14 22:28:45 +01:00