mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
WindowServer: Fix incorrect "window left" event after button drag
This fixes an issue where we'd send a "cursor has left the window" message incorrectly to the client after a button was clicked and the user moved the cursor a little without releasing the button. The issue was that we didn't update the 'hovered_window' out param in mouse event processing in the case where we had an active input window set.
This commit is contained in:
parent
b24b111298
commit
af6483cabb
Notes:
sideshowbarker
2024-07-19 12:42:37 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/af6483cabbf
1 changed files with 8 additions and 0 deletions
|
@ -720,6 +720,14 @@ void WSWindowManager::process_mouse_event(WSMouseEvent& event, WSWindow*& hovere
|
|||
if (event.type() == WSEvent::MouseUp && event.buttons() == 0) {
|
||||
m_active_input_window = nullptr;
|
||||
}
|
||||
|
||||
for_each_visible_window_from_front_to_back([&](auto& window) {
|
||||
if (window.frame().rect().contains(event.position())) {
|
||||
hovered_window = &window;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
} else {
|
||||
for_each_visible_window_from_front_to_back([&](WSWindow& window) {
|
||||
auto window_frame_rect = window.frame().rect();
|
||||
|
|
Loading…
Reference in a new issue