client: Support Xdg activation across shell surfaces
XDG activation operates on wl_surfaces, which can be used on all shell types. For the case of self activation there is was cast to the xdg shellintegration on the focused window in order to populate the appId. Only this part needs to be guarded, not the whole activation. Pick-to: 6.6 Pick-to: 6.7 Change-Id: If44cc800b7cd98141ba05ba5d1cf0812ef777e7a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Marco Martin <mart@kde.org> Reviewed-by: David Redondo <qt@david-redondo.de>
This commit is contained in:
parent
ef30575d37
commit
00fc00115d
@ -637,17 +637,20 @@ bool QWaylandXdgSurface::requestActivate()
|
|||||||
// focus stealing prevention indication, so requestXdgActivationToken call
|
// focus stealing prevention indication, so requestXdgActivationToken call
|
||||||
// is still necessary in that case.
|
// is still necessary in that case.
|
||||||
const auto wlWindow = focusWindow ? static_cast<QWaylandWindow*>(focusWindow->handle()) : m_window;
|
const auto wlWindow = focusWindow ? static_cast<QWaylandWindow*>(focusWindow->handle()) : m_window;
|
||||||
if (const auto xdgSurface = qobject_cast<QWaylandXdgSurface *>(wlWindow->shellSurface())) {
|
|
||||||
if (const auto seat = wlWindow->display()->lastInputDevice()) {
|
QString appId;
|
||||||
const auto tokenProvider = activation->requestXdgActivationToken(
|
if (const auto xdgSurface = qobject_cast<QWaylandXdgSurface *>(wlWindow->shellSurface()))
|
||||||
wlWindow->display(), wlWindow->wlSurface(), seat->serial(), xdgSurface->m_appId);
|
appId = xdgSurface->m_appId;
|
||||||
connect(tokenProvider, &QWaylandXdgActivationTokenV1::done, this,
|
|
||||||
[this, tokenProvider](const QString &token) {
|
if (const auto seat = wlWindow->display()->lastInputDevice()) {
|
||||||
m_shell->activation()->activate(token, window()->wlSurface());
|
const auto tokenProvider = activation->requestXdgActivationToken(
|
||||||
tokenProvider->deleteLater();
|
wlWindow->display(), wlWindow->wlSurface(), seat->serial(), appId);
|
||||||
});
|
connect(tokenProvider, &QWaylandXdgActivationTokenV1::done, this,
|
||||||
return true;
|
[this, tokenProvider](const QString &token) {
|
||||||
}
|
m_shell->activation()->activate(token, window()->wlSurface());
|
||||||
|
tokenProvider->deleteLater();
|
||||||
|
});
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user