From 68a6cf54a06597edf428ab1c6adb0f3729f3da10 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 23 Nov 2014 07:15:35 -0800 Subject: [PATCH 1/2] Remove unused members Clang found two problems with this from QWaylandDataDeviceManager. First, it's a class, not a struct. Second, nothing is using this private member. qwaylanddatadevicemanager_p.h:66:5: warning: struct 'wl_data_device_manager' was previously declared as a class [-Wmismatched-tags] qwaylanddatadevicemanager_p.h:66:36: warning: private field 'm_data_device_manager' is not used [-Wunused-private-field] And also this one: qwaylandextendedoutput_p.h:61:21: warning: private field 'm_screen' is not used [-Wunused-private-field] Change-Id: Ifc8f28f92190547dcb0a5319aa6fc14277894f15 Reviewed-by: Giulio Camuffo --- src/plugins/platforms/wayland/qwaylanddatadevicemanager_p.h | 1 - src/plugins/platforms/wayland/qwaylandextendedoutput.cpp | 2 +- src/plugins/platforms/wayland/qwaylandextendedoutput_p.h | 4 ---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylanddatadevicemanager_p.h b/src/plugins/platforms/wayland/qwaylanddatadevicemanager_p.h index 55583c61b4c..3ed21d26a1f 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevicemanager_p.h +++ b/src/plugins/platforms/wayland/qwaylanddatadevicemanager_p.h @@ -63,7 +63,6 @@ public: QWaylandDisplay *display() const; private: - struct wl_data_device_manager *m_data_device_manager; QWaylandDisplay *m_display; }; diff --git a/src/plugins/platforms/wayland/qwaylandextendedoutput.cpp b/src/plugins/platforms/wayland/qwaylandextendedoutput.cpp index c34f5d317e0..bb6a4779e90 100644 --- a/src/plugins/platforms/wayland/qwaylandextendedoutput.cpp +++ b/src/plugins/platforms/wayland/qwaylandextendedoutput.cpp @@ -51,8 +51,8 @@ QT_BEGIN_NAMESPACE QWaylandExtendedOutput::QWaylandExtendedOutput(QWaylandScreen *screen, ::qt_extended_output *extended_output) : QtWayland::qt_extended_output(extended_output) - , m_screen(screen) { + Q_UNUSED(screen); } QT_END_NAMESPACE diff --git a/src/plugins/platforms/wayland/qwaylandextendedoutput_p.h b/src/plugins/platforms/wayland/qwaylandextendedoutput_p.h index 71bd3fce295..35ac194a427 100644 --- a/src/plugins/platforms/wayland/qwaylandextendedoutput_p.h +++ b/src/plugins/platforms/wayland/qwaylandextendedoutput_p.h @@ -55,10 +55,6 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandExtendedOutput : public QtWayland::qt_exte { public: QWaylandExtendedOutput(QWaylandScreen *screen, struct ::qt_extended_output *extended_output); - -private: - - QWaylandScreen *m_screen; }; QT_END_NAMESPACE From 6723e2148d05e0abd2731a81213600fe2f50a3f3 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Wed, 7 Jan 2015 22:31:43 +0200 Subject: [PATCH 2/2] Set the composing string of the wayland input method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-43346 Change-Id: I9bc6d804ddca59a7a0173b8f0d3ec2f268fe9a59 Reviewed-by: Jørgen Lind --- .../platforms/wayland/qwaylandinputcontext.cpp | 16 ++++++++++++++++ .../platforms/wayland/qwaylandinputcontext_p.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylandinputcontext.cpp b/src/plugins/platforms/wayland/qwaylandinputcontext.cpp index 8a711955e49..e189b945134 100644 --- a/src/plugins/platforms/wayland/qwaylandinputcontext.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputcontext.cpp @@ -124,6 +124,18 @@ void QWaylandTextInput::updateState() commit_state(++m_serial); } +void QWaylandTextInput::text_input_preedit_string(uint32_t serial, const QString &text, const QString &commit) +{ + Q_UNUSED(serial) + if (!QGuiApplication::focusObject()) + return; + + m_commit = commit; + QList attributes; + QInputMethodEvent event(text, attributes); + QCoreApplication::sendEvent(QGuiApplication::focusObject(), &event); +} + void QWaylandTextInput::text_input_commit_string(uint32_t serial, const QString &text) { Q_UNUSED(serial); @@ -133,6 +145,8 @@ void QWaylandTextInput::text_input_commit_string(uint32_t serial, const QString QInputMethodEvent event; event.setCommitString(text); QCoreApplication::sendEvent(QGuiApplication::focusObject(), &event); + + m_commit = QString(); } void QWaylandTextInput::text_input_enter(wl_surface *) @@ -143,6 +157,8 @@ void QWaylandTextInput::text_input_enter(wl_surface *) void QWaylandTextInput::text_input_leave() { + if (!m_commit.isEmpty()) + text_input_commit_string(0, m_commit); } void QWaylandTextInput::text_input_keysym(uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) diff --git a/src/plugins/platforms/wayland/qwaylandinputcontext_p.h b/src/plugins/platforms/wayland/qwaylandinputcontext_p.h index 1f7e4e3616f..fbb26b9bf9d 100644 --- a/src/plugins/platforms/wayland/qwaylandinputcontext_p.h +++ b/src/plugins/platforms/wayland/qwaylandinputcontext_p.h @@ -60,6 +60,7 @@ public: void updateState(); protected: + void text_input_preedit_string(uint32_t serial, const QString &text, const QString &commit) Q_DECL_OVERRIDE; void text_input_commit_string(uint32_t serial, const QString &text) Q_DECL_OVERRIDE; void text_input_enter(wl_surface *surface) Q_DECL_OVERRIDE; void text_input_leave() Q_DECL_OVERRIDE;