diff --git a/autotests/integration/kwin_wayland_test.h b/autotests/integration/kwin_wayland_test.h index 87a048f12c..d9143c3416 100644 --- a/autotests/integration/kwin_wayland_test.h +++ b/autotests/integration/kwin_wayland_test.h @@ -479,7 +479,7 @@ protected: private: std::unique_ptr m_inputSurface; - QtWayland::zwp_input_panel_surface_v1 *m_inputMethodSurface = nullptr; + std::unique_ptr m_inputMethodSurface; struct ::zwp_input_method_context_v1 *m_context = nullptr; Mode m_mode = Mode::TopLevel; }; @@ -694,9 +694,9 @@ enum class CreationSetup { CreateAndConfigure, /// commit and wait for the configure event, making this surface ready to commit buffers }; -QtWayland::zwp_input_panel_surface_v1 *createInputPanelSurfaceV1(KWayland::Client::Surface *surface, - KWayland::Client::Output *output, - MockInputMethod::Mode mode); +std::unique_ptr createInputPanelSurfaceV1(KWayland::Client::Surface *surface, + KWayland::Client::Output *output, + MockInputMethod::Mode mode); FractionalScaleV1 *createFractionalScaleV1(KWayland::Client::Surface *surface); diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp index 3c598ca9df..828f18e680 100644 --- a/autotests/integration/test_helpers.cpp +++ b/autotests/integration/test_helpers.cpp @@ -357,8 +357,7 @@ void MockInputMethod::zwp_input_method_v1_deactivate(struct ::zwp_input_method_c m_inputSurface->release(); m_inputSurface->destroy(); m_inputSurface.reset(); - delete m_inputMethodSurface; - m_inputMethodSurface = nullptr; + m_inputMethodSurface.reset(); } } @@ -936,16 +935,14 @@ std::unique_ptr createLayerSurfaceV1(KWayland::Client::Surface * return shellSurface; } -QtWayland::zwp_input_panel_surface_v1 *createInputPanelSurfaceV1(KWayland::Client::Surface *surface, KWayland::Client::Output *output, MockInputMethod::Mode mode) +std::unique_ptr createInputPanelSurfaceV1(KWayland::Client::Surface *surface, KWayland::Client::Output *output, MockInputMethod::Mode mode) { if (!s_waylandConnection.inputPanelV1) { qWarning() << "Unable to create the input panel surface. The interface input_panel global is not bound"; return nullptr; } - QtWayland::zwp_input_panel_surface_v1 *s = new QtWayland::zwp_input_panel_surface_v1(s_waylandConnection.inputPanelV1->get_input_panel_surface(*surface)); - + auto s = std::make_unique(s_waylandConnection.inputPanelV1->get_input_panel_surface(*surface)); if (!s->isInitialized()) { - delete s; return nullptr; }