diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-08-22 00:10:35 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-08-22 00:10:35 +0200 |
commit | 100fbb51abc7cf8bc373caf0836601cfd9a8c1f1 (patch) | |
tree | d9ab2475fda8e3666475816fd22283e07d04b57f /platform/windows/display_server_windows.cpp | |
parent | 78f47abe2b66fb863a803debc28b470d10f8ced2 (diff) | |
parent | 0987a9dc0690c272534d2e550296b233a7e53eb3 (diff) | |
download | redot-engine-100fbb51abc7cf8bc373caf0836601cfd9a8c1f1.tar.gz |
Merge pull request #95665 from Hilderin/fix-drag-drop-between-window
Fix drag&drop between window on Windows
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 635e8326e2..b55eda0e51 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -4951,6 +4951,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: { |