From 5475751c7b2a297a20ed0f01ad8a24205670e65c Mon Sep 17 00:00:00 2001 From: Weng Xuetian Date: Tue, 4 Jan 2022 11:24:45 -0800 Subject: [PATCH] Fix testTextInputV3Interface Put EnableEmitter in the anonymous namespace to avoid it to be linked to the wrong implementation. --- src/wayland/textinput_v2_interface.cpp | 23 ++++++++++++++--------- src/wayland/textinput_v3_interface.cpp | 24 ++++++++++++++---------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/wayland/textinput_v2_interface.cpp b/src/wayland/textinput_v2_interface.cpp index 385ece3b59..011e760196 100644 --- a/src/wayland/textinput_v2_interface.cpp +++ b/src/wayland/textinput_v2_interface.cpp @@ -10,10 +10,13 @@ namespace KWaylandServer { -static const quint32 s_version = 1; + +namespace +{ +const quint32 s_version = 1; // helpers -static TextInputContentHints convertContentHint(uint32_t hint) +TextInputContentHints convertContentHint(uint32_t hint) { const auto hints = zwp_text_input_v2_content_hint(hint); TextInputContentHints ret = TextInputContentHint::None; @@ -51,7 +54,7 @@ static TextInputContentHints convertContentHint(uint32_t hint) return ret; } -static TextInputContentPurpose convertContentPurpose(uint32_t purpose) +TextInputContentPurpose convertContentPurpose(uint32_t purpose) { const auto wlPurpose = QtWaylandServer::zwp_text_input_v2::content_purpose(purpose); @@ -87,12 +90,6 @@ static TextInputContentPurpose convertContentPurpose(uint32_t purpose) } } -TextInputManagerV2InterfacePrivate::TextInputManagerV2InterfacePrivate(TextInputManagerV2Interface *_q, Display *display) - : QtWaylandServer::zwp_text_input_manager_v2(*display, s_version) - , q(_q) -{ -} - class EnabledEmitter { public: @@ -113,6 +110,14 @@ private: const bool m_wasEnabled; }; +} + +TextInputManagerV2InterfacePrivate::TextInputManagerV2InterfacePrivate(TextInputManagerV2Interface *_q, Display *display) + : QtWaylandServer::zwp_text_input_manager_v2(*display, s_version) + , q(_q) +{ +} + void TextInputManagerV2InterfacePrivate::zwp_text_input_manager_v2_destroy(Resource *resource) { wl_resource_destroy(resource->handle); diff --git a/src/wayland/textinput_v3_interface.cpp b/src/wayland/textinput_v3_interface.cpp index 76dee28d74..48bd139ea2 100644 --- a/src/wayland/textinput_v3_interface.cpp +++ b/src/wayland/textinput_v3_interface.cpp @@ -12,9 +12,11 @@ namespace KWaylandServer { -static const quint32 s_version = 1; +namespace +{ +const quint32 s_version = 1; -static TextInputContentHints convertContentHint(uint32_t hint) +TextInputContentHints convertContentHint(uint32_t hint) { const auto hints = zwp_text_input_v3_content_hint(hint); TextInputContentHints ret = TextInputContentHint::None; @@ -52,7 +54,7 @@ static TextInputContentHints convertContentHint(uint32_t hint) return ret; } -static TextInputContentPurpose convertContentPurpose(uint32_t purpose) +TextInputContentPurpose convertContentPurpose(uint32_t purpose) { const auto wlPurpose = QtWaylandServer::zwp_text_input_v3::content_purpose(purpose); @@ -90,7 +92,7 @@ static TextInputContentPurpose convertContentPurpose(uint32_t purpose) } } -static TextInputChangeCause convertChangeCause(uint32_t cause) +TextInputChangeCause convertChangeCause(uint32_t cause) { const auto wlCause = QtWaylandServer::zwp_text_input_v3::change_cause(cause); switch (wlCause) { @@ -102,12 +104,6 @@ static TextInputChangeCause convertChangeCause(uint32_t cause) } } -TextInputManagerV3InterfacePrivate::TextInputManagerV3InterfacePrivate(TextInputManagerV3Interface *_q, Display *display) - : QtWaylandServer::zwp_text_input_manager_v3(*display, s_version) - , q(_q) -{ -} - class EnabledEmitter { public: @@ -128,6 +124,14 @@ private: const bool m_wasEnabled; }; +} + +TextInputManagerV3InterfacePrivate::TextInputManagerV3InterfacePrivate(TextInputManagerV3Interface *_q, Display *display) + : QtWaylandServer::zwp_text_input_manager_v3(*display, s_version) + , q(_q) +{ +} + void TextInputManagerV3InterfacePrivate::zwp_text_input_manager_v3_destroy(Resource *resource) { wl_resource_destroy(resource->handle);