From 2e1320f2645d6082db57e4d430e908e9792dc7cc Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Tue, 27 Apr 2021 01:17:00 +0200 Subject: [PATCH] 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. --- Userland/Services/WindowServer/WindowManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index b273516e56..31ecedc698 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/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&)