| 231 | } |
| 232 | |
| 233 | RectF InputMethod::cursorRectangle() const |
| 234 | { |
| 235 | RectF localCursorRect; |
| 236 | auto t2 = waylandServer()->seat()->textInputV2(); |
| 237 | auto t3 = waylandServer()->seat()->textInputV3(); |
| 238 | auto inputContext = waylandServer()->inputMethod()->context(); |
| 239 | if (!inputContext) { |
| 240 | return {}; |
| 241 | } |
| 242 | if (t2 && t2->isEnabled()) { |
| 243 | localCursorRect = t2->cursorRectangle(); |
| 244 | } |
| 245 | if (t3 && t3->isEnabled()) { |
| 246 | localCursorRect = t3->cursorRectangle(); |
| 247 | } |
| 248 | |
| 249 | if (auto textWindow = waylandServer()->findWindow(waylandServer()->seat()->focusedTextInputSurface())) { |
| 250 | return localCursorRect.translated(textWindow->bufferGeometry().topLeft()); |
| 251 | } |
| 252 | return {}; |
| 253 | } |
| 254 | |
| 255 | void InputMethod::setActive(bool active) |
| 256 | { |