Windows drag&drop: Use correct window for drag target processing
GetFocus will return the window that currently has keyboard focus. This
is not what we want for drag and drop handling though. Use the window
under mouse and process events for that window when doing the touch/pen
input workaround. If no window is found we fall back to the focus
window. Followup to 31e7790102
Fixes: QTBUG-111149
Pick-to: 6.5 6.4 6.2
Change-Id: Ib8233debc267df0cc19b21c1dc5c6881d018d84a
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
6b9977c4ad
commit
c912bde52a
@ -648,7 +648,8 @@ IDropTargetHelper* QWindowsDrag::dropHelper() {
|
||||
// We process pointer messages for touch/pen and generate mouse input through SendInput() to trigger DoDragDrop()
|
||||
static HRESULT startDoDragDrop(LPDATAOBJECT pDataObj, LPDROPSOURCE pDropSource, DWORD dwOKEffects, LPDWORD pdwEffect)
|
||||
{
|
||||
HWND hwnd = ::GetFocus();
|
||||
QWindow *underMouse = QWindowsContext::instance()->windowUnderMouse();
|
||||
const HWND hwnd = underMouse ? reinterpret_cast<HWND>(underMouse->winId()) : ::GetFocus();
|
||||
bool starting = false;
|
||||
|
||||
for (;;) {
|
||||
|
Loading…
Reference in New Issue
Block a user