Skip to content

Commit

Permalink
Fix LayerSurface to work as attached properties
Browse files Browse the repository at this point in the history
  • Loading branch information
plfiorini committed Jan 17, 2024
1 parent e4727da commit 57a4d2c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/interfaces/layersurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,12 @@ void LayerSurface::setLayerEnabled(bool enabled)

LayerSurface *LayerSurface::get(QWindow *window)
{
return globalLayerSurfaces->value(window, nullptr);
if (globalLayerSurfaces->contains(window))
return globalLayerSurfaces->value(window);

auto *layerSurface = new LayerSurface();
globalLayerSurfaces->insert(window, layerSurface);
return layerSurface;
}

LayerSurface *LayerSurface::qmlAttachedProperties(QObject *object)
Expand Down

0 comments on commit 57a4d2c

Please sign in to comment.