Skip to content

Commit 5b44530

Browse files
committed
Avoid repeated shell surface repositioning
1 parent 316d2fd commit 5b44530

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

apps/desktop-tauri/src-tauri/src/status_surfaces.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ fn reduce_surface_phase(current: SurfacePhase, foreground: ForegroundClass) -> S
6363
};
6464
let action = if next.suspension_reason == SurfaceSuspensionReason::Fullscreen {
6565
ReconcileAction::Suspend
66-
} else if foreground == ForegroundClass::ShellTransient {
67-
// The desktop shell can remain foreground after Start, Explorer,
68-
// taskbar, or Win+D. Re-run the non-activating restore path so a
69-
// shell-owned z-order change cannot make enabled surfaces disappear.
66+
} else if current.foreground != ForegroundClass::ShellTransient
67+
&& foreground == ForegroundClass::ShellTransient
68+
{
69+
// Restore once when entering a shell-owned foreground state. If the
70+
// desktop shell remains foreground, reconciliation uses the cheaper
71+
// non-activating topmost assertion below.
7072
ReconcileAction::Restore
7173
} else if current.suspension_reason == SurfaceSuspensionReason::Fullscreen
7274
|| current.foreground == ForegroundClass::ShellTransient
@@ -519,7 +521,7 @@ mod tests {
519521
};
520522
assert_eq!(
521523
reduce_surface_phase(current, ForegroundClass::ShellTransient).action,
522-
ReconcileAction::Restore
524+
ReconcileAction::KeepVisible
523525
);
524526
}
525527

0 commit comments

Comments
 (0)