mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-16 06:30:41 +00:00
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.
This commit is contained in:
parent
83dfc4aa46
commit
2e1320f264
|
@ -414,6 +414,7 @@ void WindowManager::notify_rect_changed(Window& window, const Gfx::IntRect& old_
|
||||||
AppletManager::the().relayout();
|
AppletManager::the().relayout();
|
||||||
|
|
||||||
MenuManager::the().refresh();
|
MenuManager::the().refresh();
|
||||||
|
reevaluate_hovered_window(&window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::notify_opacity_changed(Window&)
|
void WindowManager::notify_opacity_changed(Window&)
|
||||||
|
|
Loading…
Reference in a new issue