Commit 2f75ddcb authored by Nicolas Fella's avatar Nicolas Fella Committed by Tomaz Canabrava
Browse files

Fix window activation when clicking on urls

In order to properly raise the resulting browser window on Wayland or on X11 with focus stealing protection we need to follow the relevant protocols (xdg-activation on Wayland, startup notifications on X11)

QDesktopServices::openUrl doesn't do that. Instead use KIO::OpenUrlJob which implements those protocols
parent ee7be150
Pipeline #232850 passed with stage
in 3 minutes and 36 seconds
......@@ -10,9 +10,9 @@
#include <QAction>
#include <QApplication>
#include <QClipboard>
#include <QDesktopServices>
#include <QRegularExpression>
#include <KIO/OpenUrlJob>
#include <KLocalizedString>
#include <QIcon>
#include <QMouseEvent>
......@@ -75,7 +75,8 @@ void UrlFilterHotSpot::activate(QObject *object)
url.prepend(QLatin1String("mailto:"));
}
QDesktopServices::openUrl(QUrl(url));
auto *job = new KIO::OpenUrlJob(QUrl(url));
job->start();
}
}
......
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