Prechádzať zdrojové kódy

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.
Andreas Kling 5 rokov pred
rodič
commit
fd06164fa0
1 zmenil súbory, kde vykonal 6 pridanie a 0 odobranie
  1. 6 0
      Servers/WindowServer/WSWindowManager.cpp

+ 6 - 0
Servers/WindowServer/WSWindowManager.cpp

@@ -312,6 +312,8 @@ void WSWindowManager::add_window(WSWindow& window)
     if (m_switcher.is_visible() && window.type() != WSWindowType::WindowSwitcher)
         m_switcher.refresh();
 
+    recompute_occlusions();
+
     if (window.listens_to_wm_events()) {
         for_each_window([&](WSWindow& 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.append(&window);
 
+    recompute_occlusions();
+
     set_active_window(&window);
 }
 
@@ -347,6 +351,8 @@ void WSWindowManager::remove_window(WSWindow& window)
     if (m_switcher.is_visible() && window.type() != WSWindowType::WindowSwitcher)
         m_switcher.refresh();
 
+    recompute_occlusions();
+
     for_each_window_listening_to_wm_events([&window](WSWindow& listener) {
         if (!(listener.wm_event_mask() & WSWMEventMask::WindowRemovals))
             return IterationDecision::Continue;