diff --git a/src/lib/webengine/webpage.cpp b/src/lib/webengine/webpage.cpp index 343ca6c67..12d8f947d 100644 --- a/src/lib/webengine/webpage.cpp +++ b/src/lib/webengine/webpage.cpp @@ -591,6 +591,15 @@ QWebEnginePage* WebPage::createWindow(QWebEnginePage::WebWindowType type) int index = window->tabWidget()->addView(QUrl(), pos); TabbedWebView* view = window->weView(index); view->setPage(new WebPage); + // Workaround focus issue when creating tab + if (pos.testFlag(Qz::NT_SelectedTab)) { + QPointer pview = view; + QTimer::singleShot(0, this, [pview]() { + if (pview && pview->webTab()->isCurrentTab()) { + pview->setFocus(); + } + }); + } return view->page(); };