autotests: Make layer shell surface factory function return a std::unique_ptr

This commit is contained in:
Vlad Zahorodnii 2024-03-10 21:38:22 +02:00
parent ad747daf4f
commit f723b11a9a
2 changed files with 6 additions and 6 deletions

View file

@ -682,10 +682,10 @@ std::unique_ptr<KWayland::Client::Surface> createSurface();
KWayland::Client::SubSurface *createSubSurface(KWayland::Client::Surface *surface,
KWayland::Client::Surface *parentSurface, QObject *parent = nullptr);
LayerSurfaceV1 *createLayerSurfaceV1(KWayland::Client::Surface *surface,
const QString &scope,
KWayland::Client::Output *output = nullptr,
LayerShellV1::layer layer = LayerShellV1::layer_top);
std::unique_ptr<LayerSurfaceV1> createLayerSurfaceV1(KWayland::Client::Surface *surface,
const QString &scope,
KWayland::Client::Output *output = nullptr,
LayerShellV1::layer layer = LayerShellV1::layer_top);
TextInputManagerV3 *waylandTextInputManagerV3();

View file

@ -918,7 +918,7 @@ KWayland::Client::SubSurface *createSubSurface(KWayland::Client::Surface *surfac
return s;
}
LayerSurfaceV1 *createLayerSurfaceV1(KWayland::Client::Surface *surface, const QString &scope, KWayland::Client::Output *output, LayerShellV1::layer layer)
std::unique_ptr<LayerSurfaceV1> createLayerSurfaceV1(KWayland::Client::Surface *surface, const QString &scope, KWayland::Client::Output *output, LayerShellV1::layer layer)
{
LayerShellV1 *shell = s_waylandConnection.layerShellV1;
if (!shell) {
@ -931,7 +931,7 @@ LayerSurfaceV1 *createLayerSurfaceV1(KWayland::Client::Surface *surface, const Q
nativeOutput = *output;
}
LayerSurfaceV1 *shellSurface = new LayerSurfaceV1();
auto shellSurface = std::make_unique<LayerSurfaceV1>();
shellSurface->init(shell->get_layer_surface(*surface, nativeOutput, layer, scope));
return shellSurface;