QWaylandWindow: prevent a crash when calling requestXdgActivationToken
It could crash if it's called when there's no mShellSurface Pick-to: 6.9 6.8 Change-Id: I9b279e915ea661b121da672ebd46be458a1a9218 Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
parent
faea5e128a
commit
71c4dab8d0
@ -1787,12 +1787,20 @@ void QWaylandWindow::setOpaqueArea(const QRegion &opaqueArea)
|
||||
|
||||
void QWaylandWindow::requestXdgActivationToken(uint serial)
|
||||
{
|
||||
if (!mShellSurface) {
|
||||
qCWarning(lcQpaWayland) << "requestXdgActivationToken is called with no surface role created, emitting synthetic signal";
|
||||
Q_EMIT xdgActivationTokenCreated({});
|
||||
return;
|
||||
}
|
||||
mShellSurface->requestXdgActivationToken(serial);
|
||||
}
|
||||
|
||||
void QWaylandWindow::setXdgActivationToken(const QString &token)
|
||||
{
|
||||
mShellSurface->setXdgActivationToken(token);
|
||||
if (mShellSurface)
|
||||
mShellSurface->setXdgActivationToken(token);
|
||||
else
|
||||
qCWarning(lcQpaWayland) << "setXdgActivationToken is called with no surface role created, token" << token << "discarded";
|
||||
}
|
||||
|
||||
void QWaylandWindow::addChildPopup(QWaylandWindow *child)
|
||||
|
Loading…
x
Reference in New Issue
Block a user