Skip to content

Commit

Permalink
Merge pull request #68099 from Sauermann/fix-popup-mouse-offset
Browse files Browse the repository at this point in the history
Fix mouse offset for unfocused popups
  • Loading branch information
akien-mga committed Nov 1, 2022
2 parents c29fe31 + 88feacd commit ec3c3af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ec3c3af

Please sign in to comment.