summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-01 08:20:04 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-01 08:20:04 +0100
commitec3c3afeaf820c1126c802e5d542bcfc537ee5a0 (patch)
tree0c3645de0e45345ad47c3c13cfd7424eab039450 /platform
parentc29fe310f1b782cbf588ccf7040cf1606eba6769 (diff)
parent88feacdad53cd315d6f3e25cac186ee05717f0e2 (diff)
Merge pull request #68099 from Sauermann/fix-popup-mouse-offset
Fix mouse offset for unfocused popups
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/display_server_windows.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index d99670243e..9d0a2578fb 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -2882,6 +2882,12 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
old_x = mm->get_position().x;
old_y = mm->get_position().y;
+ if (!windows[receiving_window_id].window_has_focus) {
+ // In case of unfocused Popups, adjust event position.
+ Point2i pos = mm->get_position() - window_get_position(receiving_window_id) + window_get_position(window_id);
+ mm->set_position(pos);
+ mm->set_global_position(pos);
+ }
Input::get_singleton()->parse_input_event(mm);
} break;