Close layer shell window if its preferred output has been removed

The given preferred output can be already removed from the Workspace
when the layer shell window is created. In which case, we should close
the layer shell window.
wilder/Plasma/6.3
Vlad Zahorodnii 1 year ago
parent 71c9fd7bc0
commit 002567476d
  1. 14
      src/layershellv1integration.cpp

@ -31,11 +31,15 @@ LayerShellV1Integration::LayerShellV1Integration(QObject *parent)
void LayerShellV1Integration::createWindow(LayerSurfaceV1Interface *shellSurface)
{
Output *output = shellSurface->output() ? shellSurface->output()->handle() : workspace()->activeOutput();
if (!output) {
qCWarning(KWIN_CORE) << "Could not find any suitable output for a layer surface";
shellSurface->sendClosed();
return;
Output *output;
if (OutputInterface *preferredOutput = shellSurface->output()) {
if (preferredOutput->isRemoved()) {
shellSurface->sendClosed();
return;
}
output = preferredOutput->handle();
} else {
output = workspace()->activeOutput();
}
Q_EMIT windowCreated(new LayerShellV1Window(shellSurface, output, this));

Loading…
Cancel
Save