QGenericUnixServices: ensure xdg activation token callback is called
The callback doesn't get called if the signal is emitted immediately or if hitting the early returns Fixes: QTBUG-113995 Pick-to: 6.6 6.5 Change-Id: Ib3e1d324a2becd8148cd76b4441fce5c4cc725e8 Reviewed-by: David Redondo <qt@david-redondo.de> Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
parent
9b40272562
commit
d524f0a756
@ -421,6 +421,7 @@ void runWithXdgActivationToken(F &&functionToCall)
|
|||||||
QWindow *window = qGuiApp->focusWindow();
|
QWindow *window = qGuiApp->focusWindow();
|
||||||
|
|
||||||
if (!window) {
|
if (!window) {
|
||||||
|
functionToCall({});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,13 +431,14 @@ void runWithXdgActivationToken(F &&functionToCall)
|
|||||||
dynamic_cast<QNativeInterface::Private::QWaylandWindow *>(window->handle());
|
dynamic_cast<QNativeInterface::Private::QWaylandWindow *>(window->handle());
|
||||||
|
|
||||||
if (!waylandWindow || !waylandApp) {
|
if (!waylandWindow || !waylandApp) {
|
||||||
|
functionToCall({});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
waylandWindow->requestXdgActivationToken(waylandApp->lastInputSerial());
|
|
||||||
QObject::connect(waylandWindow,
|
QObject::connect(waylandWindow,
|
||||||
&QNativeInterface::Private::QWaylandWindow::xdgActivationTokenCreated,
|
&QNativeInterface::Private::QWaylandWindow::xdgActivationTokenCreated,
|
||||||
waylandWindow, functionToCall, Qt::SingleShotConnection);
|
waylandWindow, functionToCall, Qt::SingleShotConnection);
|
||||||
|
waylandWindow->requestXdgActivationToken(waylandApp->lastInputSerial());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QGenericUnixServices::openUrl(const QUrl &url)
|
bool QGenericUnixServices::openUrl(const QUrl &url)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user