Skip to content

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Sep 9, 2025

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.

This does help with a test client, but not with the client I was trying to fix; so I need to do a bit more testing here...

Comment on lines 276 to 283
matches!(
with_states(l.wl_surface(), |states| states
.cached_state
.get::<LayerSurfaceCachedState>()
.current()
.exclusive_zone),
ExclusiveZone::Exclusive(_)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd extract this part into a let is_exclusive = |layer| ..., also perhaps this needs further anchor checks as described and done below?

If the surface is:

  • not anchored
  • anchored to only two perpendicular edges (a corner),
  • anchored to only two parallel edges or anchored to all edges,

The exclusive value should be treated the same as ExclusiveZone::Neutral.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking the exclusive zone check could be moved to just a (probably private) method of struct LayerSurface.

Good catch on those other cases that are equivalent to ExclusiveZone::Neutral. Though I guess iteration order doesn't matter for "neutral" surfaces, since they shouldn't be affected by exclusive zones, or cause effects on other surfaces.

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.
@ids1024 ids1024 force-pushed the layer-shell-arrange branch from 984cd7a to 223ac50 Compare September 29, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants