diff options
Diffstat (limited to 'platform/windows/display_server_windows.cpp')
-rw-r--r-- | platform/windows/display_server_windows.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 88ab9a4af0..ca143b3a4a 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -4805,6 +4805,16 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA Input::get_singleton()->parse_input_event(mbd); } + // Propagate the button up event to the window on which the button down + // event was triggered. This is needed for drag & drop to work between windows, + // because the engine expects events to keep being processed + // on the same window dragging started. + if (mb->is_pressed()) { + last_mouse_button_down_window = window_id; + } else if (last_mouse_button_down_window != INVALID_WINDOW_ID) { + mb->set_window_id(last_mouse_button_down_window); + last_mouse_button_down_window = INVALID_WINDOW_ID; + } } break; case WM_WINDOWPOSCHANGED: { |