mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 18:07:35 +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
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) {
|
if (event.type() == WSEvent::MouseUp && event.buttons() == 0) {
|
||||||
m_active_input_window = nullptr;
|
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 {
|
} else {
|
||||||
for_each_visible_window_from_front_to_back([&](WSWindow& window) {
|
for_each_visible_window_from_front_to_back([&](WSWindow& window) {
|
||||||
auto window_frame_rect = window.frame().rect();
|
auto window_frame_rect = window.frame().rect();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue