Commit Graph

29 Commits

Author SHA1 Message Date
Stacy Harper 8e566f716c layer-shell: don't set committed flag if the property didn't change
This fixes configure loop in Sway when clients re-send same properties
on every configure event.

Original issue: https://todo.sr.ht/~mil/sxmo-tickets/413
2021-12-15 16:24:33 +03:00
Kirill Primak cdaab82020 layer-shell: move NULL buffer check to role precommit handler
This will allow compositor to access the current buffer before
unmapping.
2021-10-06 10:15:49 +02:00
tiosgz ce66244fd2 surface_at: check if surfaces are mapped 2021-10-02 11:38:40 +02:00
tiosgz 893434b2d4 for_each_surface: only iterate mapped surfaces
These functions are used mostly for rendering, where including unmapped
surfaces is undesired.

This is a breaking change. However, few to no usages will have to be
updated.
2021-10-02 11:38:40 +02:00
Simon Ser 0e34208344 xdg-shell: introduce wlr_xdg_surface.current
This holds the current state, and avoids having ad-hoc fields in
wlr_xdg_surface.
2021-09-30 23:17:32 +03:00
Kirill Primak 754f40f9cb layer-shell: add `committed` bitmask 2021-09-24 14:38:32 +02:00
Kirill Primak 59fa3637c3 layer-shell: refactor configure/state flow
Same logic as xdg-toplevel.
2021-09-23 21:22:41 +02:00
Isaac Freund 3364eec07e layer-shell: replace close() with destroy()
The protocol specifies that all requests (aside from destroy) are
ignored after the compositor sends the closed event. Therefore,
destroying the wlroots object and rendering the resource inert
when sending the closed event keeps things simpler for wlroots and
compositors.
2021-08-14 20:25:46 +02:00
Daniel Kondor b7dc4f2990 layer-shell: allow new values for keyboard-interactivity
Value is now an enum with a new value ("on-demand") that compositors can use to allow "normal" keyboard focus semantics regardless of the layer the client surface is on. An error is sent for invalid keyboard interactivity values. The old behavior is retained for clients using the previous version of the protocol.

Also adjusted the layer-shell example program to use the new keyboard interactivity options.
2021-01-12 20:13:52 +01:00
Isaac Freund 07111828c5 layer shell: rename popup iterator for consistency
This iterates over the subsurfaces of popups as well, so rename it to
match wlr_xdg_surface_for_each_popup_surface().
2021-01-12 11:26:08 +01:00
Isaac Freund b482c90e1a xdg/layer shell: reduce code duplication in iterators 2021-01-08 14:53:45 +01:00
Isaac Freund 4ee4a36c0c layer shell: add wlr_layer_surface_v1_popup_surface_at()
This function will allow compositors to implement input handling in a
way consistent with rendering more easily.

Calling wlr_layer_surface_v1_surface_at() and checking if the result is
a wlr_xdg_popup is flawed as there may be subsurfaces in the popup tree.
2021-01-08 12:05:13 +01:00
Isaac Freund 87e216b740 layer shell: advertise version 3
This should have been done in 45c0877 but was overlooked unfortunately.
2021-01-07 12:12:08 +01:00
Isaac Freund 8dec751a6d layer-shell: error on 0 dimension without anchors
The protocol requires clients to set opposing anchors when requesting
a width or height of 0.

The goal of this patch is not to break clients that rely on this
behavior but to improve the consistency of the layer shell ecosystem
through adherence to the protocol.
2020-10-09 15:42:46 +02:00
Isaac Freund 8ad2cc39eb layer-shell: add for_each_popup
This brings the layer-shell api in line with that of xdg-shell and
avoids reimplementing this function in every compositor in order to
render layer shell popups correctly.
2020-09-10 17:44:55 +02:00
Antonin Décimo d9bb792794 Fix incorrect format parameters 2020-07-27 10:49:19 +02:00
Isaac Freund 92c85858a9 layer-shell: remove unused surface list
This was rendered useless in 5cde359.
2020-07-07 12:11:31 +02:00
Isaac Freund 45c0877e34 layer-shell: upgrade to v3, implement destructor 2020-06-30 13:33:15 +02:00
Isaac Freund b937c7b05e layer-shell: handle serial wrapping overflow 2020-06-25 10:33:58 +02:00
Isaac Freund 11e94c406b layer shell: only send unmap on close if mapped 2020-05-02 18:25:09 +02:00
Simon Ser 5cde35923c Simplify globals implementation by removing destructors
Some globals are static and it doesn't make sense to destroy them before
the wl_display. For instance, wl_compositor should be created before the
display is started and shouldn't be destroyed.

For these globals, we can simplify the code by removing the destructor
and stop keeping track of wl_resources (these will be destroyed with the
wl_display by libwayland).
2019-11-25 09:01:46 -05:00
Timidger 6bd7a62c09 Use layer shell v2 2019-11-23 17:52:00 -05:00
Timidger 1724261910 layer_shell: set layer of existing surface 2019-10-16 09:41:13 -04:00
Ilia Bozhinov 8b0f1bc850 layer-shell: ignore ack_configure() on closed surfaces
When the surface is closed, we destroy all pending serials waiting to be
accepted. This means we need to ignore any future ack events, because we
can have the following events:

1. -> configure()
2. -> close()
3. <- ack_configure()

At point 3, wlroots will error the client because of invalid serial,
however the client hasn't processed close() yet.
2019-09-13 13:58:58 +03:00
Brian Ashworth fa477c77c4 wlr-layer-shell-v1: destroy xdg popups on unmap
This destroys the xdg popups associated with a layer surface when the
layer surface is unmapped. It does not make sense to keep the popups
open when unmapped.
2019-08-24 13:39:38 +09:00
Simon Ser ca45f4490c Remove all wayland-server.h includes
The documentation for wayland-server.h says:

> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.

Replacing wayland-server.h with wayland-server-core.h allows us to drop the
WL_HIDE_DEPRECATED declaration.
2019-07-27 15:49:32 -04:00
Guido Günther 692a16cef7 layer-shell: Reject requests on gone surfaces
When the surface was destroyed but the resource is still around
we might dereference a null pointer otherwise.
2019-07-16 17:38:11 +03:00
Guido Günther 91752e8285 layer-shell: Remove unused event source 2019-07-16 17:38:11 +03:00
emersion fc960e5d06 layer-shell: add _v1 suffix 2018-09-14 19:32:33 +02:00
Renamed from types/wlr_layer_shell.c (Browse further)