Fix focus in Active Qt webbrowser.
Active X controls may cause WM_SETFOCUS/WM_KILLFOCUS to be sent to native child windows. Ensure the focus widget is set correctly in these cases. Task-number: QTBUG-37126 Change-Id: I2a4cbb148eab48e47ca3f37b2076020c95d213a5 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
parent
846cc4c75c
commit
9788c0f47c
@ -143,6 +143,11 @@ void QApplicationPrivate::notifyActiveWindowChange(QWindow *previous)
|
||||
return;
|
||||
QWidget *tlw = qt_tlw_for_window(wnd);
|
||||
QApplication::setActiveWindow(tlw);
|
||||
// QTBUG-37126, Active X controls may set the focus on native child widgets.
|
||||
if (wnd && tlw && wnd != tlw->windowHandle()) {
|
||||
if (QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(wnd))
|
||||
widgetWindow->widget()->setFocus(Qt::ActiveWindowFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
static void ungrabKeyboardForPopup(QWidget *popup)
|
||||
|
Loading…
Reference in New Issue
Block a user