Avoid unnecessarily unwrapping stack_ref() after is_stack()

In a lot of cases, matching on `stack_ref()` also works.
This commit is contained in:
Ian Douglas Scott 2026-06-18 19:43:45 -07:00 committed by Ian Douglas Scott
parent 26ee83aaa7
commit f765696834
4 changed files with 20 additions and 30 deletions

View file

@ -314,8 +314,7 @@ impl CompositorHandler for State {
.then(|| state.element())
});
if let Some(window) = moved_window {
if window.is_stack() {
let stack = window.stack_ref().unwrap();
if let Some(stack) = window.stack_ref() {
if let Some(i) = stack.surfaces().position(|s| {
s.wl_surface()
.as_deref()