MCPcopy Create free account
hub / github.com/KDE/kwin / cursorRectangle

Method cursorRectangle

src/inputmethod.cpp:233–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233RectF 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
255void InputMethod::setActive(bool active)
256{

Callers 4

testCursorRectangleMethod · 0.45
testEnableDisableMethod · 0.45
testEnableDisableMethod · 0.45
resetPositionMethod · 0.45

Calls 12

waylandServerFunction · 0.85
textInputV2Method · 0.80
textInputV3Method · 0.80
inputMethodMethod · 0.80
bufferGeometryMethod · 0.80
seatMethod · 0.45
contextMethod · 0.45
isEnabledMethod · 0.45
findWindowMethod · 0.45
translatedMethod · 0.45
topLeftMethod · 0.45

Tested by 3

testCursorRectangleMethod · 0.36
testEnableDisableMethod · 0.36
testEnableDisableMethod · 0.36