mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 15:32:51 +00:00
WindowServer: Re-evaluate the mouse cursor when alpha hit-testing
A window repaint may change the alpha value, resulting in a different hit test outcome. In those cases, re-evaluate the cursor hit testing after a window was painted, and update the cursor if needed.
This commit is contained in:
parent
bd830c2dfe
commit
2d29bfc89e
Notes:
sideshowbarker
2024-07-18 22:01:58 +09:00
Author: https://github.com/tomuta
Commit: 2d29bfc89e
Pull-request: https://github.com/SerenityOS/serenity/pull/5461
Reviewed-by: https://github.com/awesomekling
4 changed files with 60 additions and 5 deletions
|
@ -603,6 +603,8 @@ void ClientConnection::handle(const Messages::WindowServer::DidFinishPainting& m
|
|||
auto& window = *(*it).value;
|
||||
for (auto& rect : message.rects())
|
||||
window.invalidate(rect);
|
||||
if (window.has_alpha_channel() && window.alpha_hit_threshold() > 0.0)
|
||||
WindowManager::the().reevaluate_hovered_window(&window);
|
||||
|
||||
WindowSwitcher::the().refresh_if_needed();
|
||||
}
|
||||
|
@ -661,7 +663,8 @@ OwnPtr<Messages::WindowServer::SetWindowCursorResponse> ClientConnection::handle
|
|||
return {};
|
||||
}
|
||||
window.set_cursor(Cursor::create((Gfx::StandardCursor)message.cursor_type()));
|
||||
Compositor::the().invalidate_cursor();
|
||||
if (&window == WindowManager::the().hovered_window())
|
||||
Compositor::the().invalidate_cursor();
|
||||
return make<Messages::WindowServer::SetWindowCursorResponse>();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue