Changeset View
Changeset View
Standalone View
Standalone View
input.cpp
Show First 20 Lines • Show All 1151 Lines • ▼ Show 20 Line(s) | 1127 | if (conn) { | |||
---|---|---|---|---|---|
1152 | connect(conn, &LibInput::Connection::touchCanceled, m_touch, &TouchInputRedirection::cancel); | 1152 | connect(conn, &LibInput::Connection::touchCanceled, m_touch, &TouchInputRedirection::cancel); | ||
1153 | connect(conn, &LibInput::Connection::touchFrame, m_touch, &TouchInputRedirection::frame); | 1153 | connect(conn, &LibInput::Connection::touchFrame, m_touch, &TouchInputRedirection::frame); | ||
1154 | if (screens()) { | 1154 | if (screens()) { | ||
1155 | setupLibInputWithScreens(); | 1155 | setupLibInputWithScreens(); | ||
1156 | } else { | 1156 | } else { | ||
1157 | connect(kwinApp(), &Application::screensCreated, this, &InputRedirection::setupLibInputWithScreens); | 1157 | connect(kwinApp(), &Application::screensCreated, this, &InputRedirection::setupLibInputWithScreens); | ||
1158 | } | 1158 | } | ||
1159 | if (auto s = findSeat()) { | 1159 | if (auto s = findSeat()) { | ||
1160 | s->setHasKeyboard(conn->hasAlphaNumericKeyboard()); | 1160 | // Workaround for QTBUG-54371: if there is no real keyboard Qt doesn't request virtual keyboard | ||
1161 | s->setHasKeyboard(true); | ||||
1161 | s->setHasPointer(conn->hasPointer()); | 1162 | s->setHasPointer(conn->hasPointer()); | ||
1162 | s->setHasTouch(conn->hasTouch()); | 1163 | s->setHasTouch(conn->hasTouch()); | ||
1163 | connect(conn, &LibInput::Connection::hasAlphaNumericKeyboardChanged, this, | 1164 | connect(conn, &LibInput::Connection::hasAlphaNumericKeyboardChanged, this, | ||
1164 | [this, s] (bool set) { | 1165 | [this] (bool set) { | ||
1165 | if (m_libInput->isSuspended()) { | 1166 | if (m_libInput->isSuspended()) { | ||
1166 | return; | 1167 | return; | ||
1167 | } | 1168 | } | ||
1168 | s->setHasKeyboard(set); | 1169 | // TODO: this should update the seat, only workaround for QTBUG-54371 | ||
1170 | emit hasAlphaNumericKeyboardChanged(set); | ||||
1169 | } | 1171 | } | ||
1170 | ); | 1172 | ); | ||
1171 | connect(conn, &LibInput::Connection::hasPointerChanged, this, | 1173 | connect(conn, &LibInput::Connection::hasPointerChanged, this, | ||
1172 | [this, s] (bool set) { | 1174 | [this, s] (bool set) { | ||
1173 | if (m_libInput->isSuspended()) { | 1175 | if (m_libInput->isSuspended()) { | ||
1174 | return; | 1176 | return; | ||
1175 | } | 1177 | } | ||
1176 | s->setHasPointer(set); | 1178 | s->setHasPointer(set); | ||
Show All 14 Lines | 1192 | if (!active) { | |||
1191 | m_libInput->deactivate(); | 1193 | m_libInput->deactivate(); | ||
1192 | } | 1194 | } | ||
1193 | } | 1195 | } | ||
1194 | ); | 1196 | ); | ||
1195 | } | 1197 | } | ||
1196 | #endif | 1198 | #endif | ||
1197 | } | 1199 | } | ||
1198 | 1200 | | |||
1201 | bool InputRedirection::hasAlphaNumericKeyboard() | ||||
1202 | { | ||||
1203 | #if HAVE_INPUT | ||||
1204 | if (m_libInput) { | ||||
1205 | return m_libInput->hasAlphaNumericKeyboard(); | ||||
1206 | } | ||||
1207 | #endif | ||||
1208 | return true; | ||||
1209 | } | ||||
1210 | | ||||
1199 | void InputRedirection::setupLibInputWithScreens() | 1211 | void InputRedirection::setupLibInputWithScreens() | ||
1200 | { | 1212 | { | ||
1201 | #if HAVE_INPUT | 1213 | #if HAVE_INPUT | ||
1202 | if (!screens() || !m_libInput) { | 1214 | if (!screens() || !m_libInput) { | ||
1203 | return; | 1215 | return; | ||
1204 | } | 1216 | } | ||
1205 | m_libInput->setScreenSize(screens()->size()); | 1217 | m_libInput->setScreenSize(screens()->size()); | ||
1206 | connect(screens(), &Screens::sizeChanged, this, | 1218 | connect(screens(), &Screens::sizeChanged, this, | ||
▲ Show 20 Lines • Show All 292 Lines • Show Last 20 Lines |