1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 04:36:34 +01:00

WebPage: Improve createWindow focus issue workaround

This commit is contained in:
David Rosca 2018-01-27 13:56:08 +01:00
parent 538299116f
commit e23edd7420
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -630,7 +630,8 @@ QWebEnginePage* WebPage::createWindow(QWebEnginePage::WebWindowType type)
// Workaround focus issue when creating tab
if (pos.testFlag(Qz::NT_SelectedTab)) {
QPointer<TabbedWebView> pview = view;
QTimer::singleShot(0, this, [pview]() {
pview->setFocus();
QTimer::singleShot(100, this, [pview]() {
if (pview && pview->webTab()->isCurrentTab()) {
pview->setFocus();
}