client: add some debug info in QWaylandTextInputv2

Pick-to: 6.9 6.8
Change-Id: Ia34ef1bd7093c7aa71b862418595a0882e251131
Reviewed-by: Inho Lee <inho.lee@qt.io>
This commit is contained in:
Liang Qi 2025-01-17 10:09:59 +01:00
parent 1d3de3e8c8
commit c5a4ab54c9
2 changed files with 30 additions and 16 deletions

View File

@ -49,8 +49,30 @@ QWaylandTextInputv2::~QWaylandTextInputv2()
destroy();
}
void QWaylandTextInputv2::showInputPanel()
{
qCDebug(qLcQpaInputMethods()) << Q_FUNC_INFO;
show_input_panel();
}
void QWaylandTextInputv2::hideInputPanel()
{
qCDebug(qLcQpaInputMethods()) << Q_FUNC_INFO;
hide_input_panel();
}
void QWaylandTextInputv2::enableSurface(::wl_surface *surface)
{
qCDebug(qLcQpaInputMethods()) << Q_FUNC_INFO << surface;
enable(surface);
}
void QWaylandTextInputv2::disableSurface(::wl_surface *surface)
{
qCDebug(qLcQpaInputMethods()) << Q_FUNC_INFO << surface;
disable(surface);
}
void QWaylandTextInputv2::reset()
{
qCDebug(qLcQpaInputMethods()) << Q_FUNC_INFO;
m_builder.reset();
m_preeditCommit = QString();
updateState(Qt::ImQueryAll, QtWayland::zwp_text_input_v2::update_state_reset);
@ -58,6 +80,7 @@ void QWaylandTextInputv2::reset()
void QWaylandTextInputv2::commit()
{
qCDebug(qLcQpaInputMethods()) << Q_FUNC_INFO;
if (QObject *o = QGuiApplication::focusObject()) {
if (!m_preeditCommit.isEmpty()) {
@ -88,6 +111,7 @@ void QWaylandTextInputv2::resetCallback(void *data, wl_callback *, uint32_t)
void QWaylandTextInputv2::updateState(Qt::InputMethodQueries queries, uint32_t flags)
{
qCDebug(qLcQpaInputMethods()) << Q_FUNC_INFO << queries << flags;
if (!QGuiApplication::focusObject())
return;
@ -181,6 +205,7 @@ Qt::LayoutDirection QWaylandTextInputv2::inputDirection() const
void QWaylandTextInputv2::zwp_text_input_v2_enter(uint32_t serial, ::wl_surface *surface)
{
qCDebug(qLcQpaInputMethods()) << Q_FUNC_INFO << serial << surface;
m_serial = serial;
m_surface = surface;
@ -189,6 +214,7 @@ void QWaylandTextInputv2::zwp_text_input_v2_enter(uint32_t serial, ::wl_surface
void QWaylandTextInputv2::zwp_text_input_v2_leave(uint32_t serial, ::wl_surface *surface)
{
qCDebug(qLcQpaInputMethods()) << Q_FUNC_INFO << serial << surface;
m_serial = serial;
if (m_surface != surface) {

View File

@ -47,22 +47,10 @@ public:
QLocale locale() const override;
Qt::LayoutDirection inputDirection() const override;
void showInputPanel() override
{
show_input_panel();
}
void hideInputPanel() override
{
hide_input_panel();
}
void enableSurface(::wl_surface *surface) override
{
enable(surface);
}
void disableSurface(::wl_surface *surface) override
{
disable(surface);
}
void showInputPanel() override;
void hideInputPanel() override;
void enableSurface(::wl_surface *surface) override;
void disableSurface(::wl_surface *surface) override;
protected:
void zwp_text_input_v2_enter(uint32_t serial, struct ::wl_surface *surface) override;