autotests: Make idle-inhibitor-v1 factory function return a std::unique_ptr

This commit is contained in:
Vlad Zahorodnii 2024-03-10 21:54:43 +02:00
parent 2922b8d0a7
commit a887b737ef
2 changed files with 3 additions and 3 deletions

View file

@ -710,7 +710,7 @@ std::unique_ptr<XdgPopup> createXdgPopupSurface(KWayland::Client::Surface *surfa
CreationSetup configureMode = CreationSetup::CreateAndConfigure);
std::unique_ptr<XdgToplevelDecorationV1> createXdgToplevelDecorationV1(XdgToplevel *toplevel);
IdleInhibitorV1 *createIdleInhibitorV1(KWayland::Client::Surface *surface);
std::unique_ptr<IdleInhibitorV1> createIdleInhibitorV1(KWayland::Client::Surface *surface);
AutoHideScreenEdgeV1 *createAutoHideScreenEdgeV1(KWayland::Client::Surface *surface, uint32_t border);
CursorShapeDeviceV1 *createCursorShapeDeviceV1(KWayland::Client::Pointer *pointer);

View file

@ -1047,7 +1047,7 @@ std::unique_ptr<XdgToplevelDecorationV1> createXdgToplevelDecorationV1(XdgToplev
return std::make_unique<XdgToplevelDecorationV1>(manager, toplevel);
}
IdleInhibitorV1 *createIdleInhibitorV1(KWayland::Client::Surface *surface)
std::unique_ptr<IdleInhibitorV1> createIdleInhibitorV1(KWayland::Client::Surface *surface)
{
IdleInhibitManagerV1 *manager = s_waylandConnection.idleInhibitManagerV1;
if (!manager) {
@ -1055,7 +1055,7 @@ IdleInhibitorV1 *createIdleInhibitorV1(KWayland::Client::Surface *surface)
return nullptr;
}
return new IdleInhibitorV1(manager, surface);
return std::make_unique<IdleInhibitorV1>(manager, surface);
}
AutoHideScreenEdgeV1 *createAutoHideScreenEdgeV1(KWayland::Client::Surface *surface, uint32_t border)