瀏覽代碼

WindowServer: Show modal window's cursor over blocked windows

When a window is blocked by a modal window from the same application,
we now prefer the modal window's cursor instead of the hovered window.
Andreas Kling 4 年之前
父節點
當前提交
ebaf20547c
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      Services/WindowServer/WindowManager.cpp

+ 8 - 2
Services/WindowServer/WindowManager.cpp

@@ -1306,8 +1306,14 @@ const Cursor& WindowManager::active_cursor() const
         }
     }
 
-    if (m_hovered_window && m_hovered_window->cursor())
-        return *m_hovered_window->cursor();
+    if (m_hovered_window) {
+        if (auto* modal_window = const_cast<Window&>(*m_hovered_window).is_blocked_by_modal_window()) {
+            if (modal_window->cursor())
+                return *modal_window->cursor();
+        } else if (m_hovered_window->cursor()) {
+            return *m_hovered_window->cursor();
+        }
+    }
 
     return *m_arrow_cursor;
 }