1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

WindowServer: Recompute window occlusions on window stack changes

When adding/removing windows, or moving a window from the front to the
back, we have to recompute everyone's occlusion states.
This commit is contained in:
Andreas Kling 2019-12-27 11:44:37 +01:00
parent 74968f0ec1
commit fd06164fa0

View file

@ -312,6 +312,8 @@ void WSWindowManager::add_window(WSWindow& window)
if (m_switcher.is_visible() && window.type() != WSWindowType::WindowSwitcher) if (m_switcher.is_visible() && window.type() != WSWindowType::WindowSwitcher)
m_switcher.refresh(); m_switcher.refresh();
recompute_occlusions();
if (window.listens_to_wm_events()) { if (window.listens_to_wm_events()) {
for_each_window([&](WSWindow& other_window) { for_each_window([&](WSWindow& other_window) {
if (&window != &other_window) { if (&window != &other_window) {
@ -335,6 +337,8 @@ void WSWindowManager::move_to_front_and_make_active(WSWindow& window)
m_windows_in_order.remove(&window); m_windows_in_order.remove(&window);
m_windows_in_order.append(&window); m_windows_in_order.append(&window);
recompute_occlusions();
set_active_window(&window); set_active_window(&window);
} }
@ -347,6 +351,8 @@ void WSWindowManager::remove_window(WSWindow& window)
if (m_switcher.is_visible() && window.type() != WSWindowType::WindowSwitcher) if (m_switcher.is_visible() && window.type() != WSWindowType::WindowSwitcher)
m_switcher.refresh(); m_switcher.refresh();
recompute_occlusions();
for_each_window_listening_to_wm_events([&window](WSWindow& listener) { for_each_window_listening_to_wm_events([&window](WSWindow& listener) {
if (!(listener.wm_event_mask() & WSWMEventMask::WindowRemovals)) if (!(listener.wm_event_mask() & WSWMEventMask::WindowRemovals))
return IterationDecision::Continue; return IterationDecision::Continue;