Disambiguate input method constants

They cause clashes in CMake Unity (Jumbo) builds.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I13b33c894818d8aebce763eaf6c961d806961a63
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
This commit is contained in:
Friedemann Kleint 2023-02-01 14:35:30 +01:00
parent 25d387c614
commit e8a052bc8f
3 changed files with 8 additions and 8 deletions

View File

@ -26,7 +26,7 @@ namespace QtWaylandClient {
namespace { namespace {
const Qt::InputMethodQueries supportedQueries = Qt::ImEnabled | const Qt::InputMethodQueries supportedQueries1 = Qt::ImEnabled |
Qt::ImSurroundingText | Qt::ImSurroundingText |
Qt::ImCursorPosition | Qt::ImCursorPosition |
Qt::ImAnchorPosition | Qt::ImAnchorPosition |
@ -92,7 +92,7 @@ void QWaylandTextInputv1::updateState(Qt::InputMethodQueries queries, uint32_t f
if (!surface || (surface != m_surface)) if (!surface || (surface != m_surface))
return; return;
queries &= supportedQueries; queries &= supportedQueries1;
// Surrounding text, cursor and anchor positions are transferred together // Surrounding text, cursor and anchor positions are transferred together
if ((queries & Qt::ImSurroundingText) || (queries & Qt::ImCursorPosition) || (queries & Qt::ImAnchorPosition)) if ((queries & Qt::ImSurroundingText) || (queries & Qt::ImCursorPosition) || (queries & Qt::ImAnchorPosition))

View File

@ -27,7 +27,7 @@ namespace QtWaylandClient {
namespace { namespace {
const Qt::InputMethodQueries supportedQueries = Qt::ImEnabled | const Qt::InputMethodQueries supportedQueries2 = Qt::ImEnabled |
Qt::ImSurroundingText | Qt::ImSurroundingText |
Qt::ImCursorPosition | Qt::ImCursorPosition |
Qt::ImAnchorPosition | Qt::ImAnchorPosition |
@ -98,7 +98,7 @@ void QWaylandTextInputv2::updateState(Qt::InputMethodQueries queries, uint32_t f
if (!surface || (surface != m_surface)) if (!surface || (surface != m_surface))
return; return;
queries &= supportedQueries; queries &= supportedQueries2;
// Surrounding text, cursor and anchor positions are transferred together // Surrounding text, cursor and anchor positions are transferred together
if ((queries & Qt::ImSurroundingText) || (queries & Qt::ImCursorPosition) || (queries & Qt::ImAnchorPosition)) if ((queries & Qt::ImSurroundingText) || (queries & Qt::ImCursorPosition) || (queries & Qt::ImAnchorPosition))

View File

@ -31,7 +31,7 @@ QWaylandTextInputv4::~QWaylandTextInputv4()
} }
namespace { namespace {
const Qt::InputMethodQueries supportedQueries = Qt::ImEnabled | const Qt::InputMethodQueries supportedQueries4 = Qt::ImEnabled |
Qt::ImSurroundingText | Qt::ImSurroundingText |
Qt::ImCursorPosition | Qt::ImCursorPosition |
Qt::ImAnchorPosition | Qt::ImAnchorPosition |
@ -51,7 +51,7 @@ void QWaylandTextInputv4::zwp_text_input_v4_enter(struct ::wl_surface *surface)
m_pendingDeleteAfterText = 0; m_pendingDeleteAfterText = 0;
enable(); enable();
updateState(supportedQueries, update_state_enter); updateState(supportedQueries4, update_state_enter);
} }
void QWaylandTextInputv4::zwp_text_input_v4_leave(struct ::wl_surface *surface) void QWaylandTextInputv4::zwp_text_input_v4_leave(struct ::wl_surface *surface)
@ -177,7 +177,7 @@ void QWaylandTextInputv4::zwp_text_input_v4_done(uint32_t serial)
QCoreApplication::sendEvent(focusObject, &event); QCoreApplication::sendEvent(focusObject, &event);
if (serial == m_currentSerial) if (serial == m_currentSerial)
updateState(supportedQueries, update_state_full); updateState(supportedQueries4, update_state_full);
} }
void QWaylandTextInputv4::reset() void QWaylandTextInputv4::reset()
@ -225,7 +225,7 @@ void QWaylandTextInputv4::updateState(Qt::InputMethodQueries queries, uint32_t f
if (!surface || (surface != m_surface)) if (!surface || (surface != m_surface))
return; return;
queries &= supportedQueries; queries &= supportedQueries4;
bool needsCommit = false; bool needsCommit = false;
QInputMethodQueryEvent event(queries); QInputMethodQueryEvent event(queries);