Commit 3d9bd69c authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Don't crash on a null QWindow

The earlier code checked for that, that check got removed inadvertently

Also restructure code to always emit the result signal in case of errors

BUG: 454341
parent 8382a78f
Pipeline #180465 passed with stage
in 2 minutes and 36 seconds
......@@ -57,15 +57,18 @@ void WindowSystem::forceActiveWindow(WId win, long int time)
void WindowSystem::requestToken(QWindow *window, uint32_t serial, const QString &app_id)
{
QPlatformNativeInterface *native = qGuiApp->platformNativeInterface();
if (!native) {
return;
}
window->create();
wl_surface *wlSurface = reinterpret_cast<wl_surface *>(native->nativeResourceForWindow(QByteArrayLiteral("surface"), window));
if (!wlSurface) {
return;
}
wl_surface *wlSurface = [](QWindow *window) -> wl_surface * {
if (!window) {
return nullptr;
}
QPlatformNativeInterface *native = qGuiApp->platformNativeInterface();
if (!native) {
return nullptr;
}
window->create();
return reinterpret_cast<wl_surface *>(native->nativeResourceForWindow(QByteArrayLiteral("surface"), window));
}(window);
WaylandXdgActivationV1 *activation = WaylandIntegration::self()->activation();
if (!activation) {
......
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