mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Workaround wrong focus when opening new tab from createWindow()
This commit is contained in:
parent
cbba636f61
commit
6f08f94e0f
@ -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<TabbedWebView> pview = view;
|
||||
QTimer::singleShot(0, this, [pview]() {
|
||||
if (pview && pview->webTab()->isCurrentTab()) {
|
||||
pview->setFocus();
|
||||
}
|
||||
});
|
||||
}
|
||||
return view->page();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user