Commit a69162a9 authored by Stefano Crocco's avatar Stefano Crocco
Browse files

Fix focus when opening page in a new tab

When opening a page in a new tab by middle-clicking a link, focus wasn't
moved to the new page but remained in the location bar. This happens
because the createNewWindow signal is emitted by
NewWindowPage::acceptNavigationRequest using an empty URL rather than
the true URL. To fix this, the real URL is passed to the createNewWindow signal.
parent e1e414a8
......@@ -866,7 +866,7 @@ bool NewWindowPage::acceptNavigationRequest(const QUrl &url, NavigationType type
KParts::WindowArgs wargs (m_windowArgs);
KParts::ReadOnlyPart* newWindowPart =nullptr;
emit part()->browserExtension()->createNewWindow(QUrl(), uargs, bargs, wargs, &newWindowPart);
emit part()->browserExtension()->createNewWindow(url, uargs, bargs, wargs, &newWindowPart);
qCDebug(WEBENGINEPART_LOG) << "Created new window" << newWindowPart;
if (!newWindowPart) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment