mirror of
https://github.com/godotengine/godot.git
synced 2025-01-23 19:12:24 -05:00
Merge pull request #68099 from Sauermann/fix-popup-mouse-offset
Fix mouse offset for unfocused popups
This commit is contained in:
commit
ec3c3afeaf
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue