Windows: Reject focus-in caused by reparenting Windows.
Calling WinAPI SetParent() causes the window to be activated, which is not desired for native child widgets. Task-number: QTBUG-32867 Change-Id: Idf61931bc425a043a4b7a98eec9ae122e234dc37 Reviewed-by: Andy Shaw <andy.shaw@digia.com>bb10
parent
d032ff6388
commit
ff77621469
|
|
@ -1063,6 +1063,15 @@ void QWindowsContext::handleFocusEvent(QtWindows::WindowsEventType et,
|
|||
modalWindow->requestActivate();
|
||||
return;
|
||||
}
|
||||
// QTBUG-32867: Invoking WinAPI SetParent() can cause focus-in for the
|
||||
// window which is not desired for native child widgets.
|
||||
if (platformWindow->testFlag(QWindowsWindow::WithinSetParent)) {
|
||||
QWindow *currentFocusWindow = QGuiApplication::focusWindow();
|
||||
if (currentFocusWindow && currentFocusWindow != platformWindow->window()) {
|
||||
currentFocusWindow->requestActivate();
|
||||
return;
|
||||
}
|
||||
}
|
||||
nextActiveWindow = platformWindow->window();
|
||||
} else {
|
||||
// Focus out: Is the next window known and different
|
||||
|
|
|
|||
Loading…
Reference in New Issue