Skip to content

Commit 984cd7a

Browse files
committed
wayland/layer: In arrange(), handle exclusive zone surfaces first
Iterate over surfaces that have an exclusive zone first, then other surfaces. This allows a surface that doesn't have an exclusive zone to be moved or resized for a later surface that does have an exclusive zone. As is probably desired.
1 parent eb45814 commit 984cd7a

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/desktop/wayland/layer.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,27 @@ impl LayerMap {
272272
);
273273
trace!("Arranging layers into {:?}", output_rect.size);
274274

275-
for layer in self.layers.iter() {
275+
let exclusive_surfaces = self.layers.iter().filter(|l| {
276+
matches!(
277+
with_states(l.wl_surface(), |states| states
278+
.cached_state
279+
.get::<LayerSurfaceCachedState>()
280+
.current()
281+
.exclusive_zone),
282+
ExclusiveZone::Exclusive(_)
283+
)
284+
});
285+
let non_exclusive_surfaces = self.layers.iter().filter(|l| {
286+
!matches!(
287+
with_states(l.wl_surface(), |states| states
288+
.cached_state
289+
.get::<LayerSurfaceCachedState>()
290+
.current()
291+
.exclusive_zone),
292+
ExclusiveZone::Exclusive(_)
293+
)
294+
});
295+
for layer in exclusive_surfaces.chain(non_exclusive_surfaces) {
276296
let surface = layer.wl_surface();
277297

278298
with_surface_tree_downward(

0 commit comments

Comments
 (0)