浏览代码

WindowServer: Reevaluate hovered window on window rect change

When a new Window instance is added to the WindowManager, it does not
yet have an updated value for `m_frame->rect()` and we're not checking
if there is a new candidate for the hovered window, which we need to do
since the mouse cursor might hover above the newly opened window.

This fixes both issues: as soon as a Window frame's rect is changed,
ask the WindowManager to reevaluate its hovered window. This takes care
of newly opened windows _and_ windows that are programmatically changed
in size.

This works because when a Window becomes hovered, the WindowManager
sends out an enter event. This event in turn triggers the Window to
evaluate the cursor type under the mouse position and to update it when
necessary.

Fixes #4809.
Jelle Raaijmakers 4 年之前
父节点
当前提交
2e1320f264
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Userland/Services/WindowServer/WindowManager.cpp

+ 1 - 0
Userland/Services/WindowServer/WindowManager.cpp

@@ -414,6 +414,7 @@ void WindowManager::notify_rect_changed(Window& window, const Gfx::IntRect& old_
         AppletManager::the().relayout();
 
     MenuManager::the().refresh();
+    reevaluate_hovered_window(&window);
 }
 
 void WindowManager::notify_opacity_changed(Window&)