MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / getWindowFromPoint

Method getWindowFromPoint

source/x11/xwindow.cpp:1093–1122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1091}
1092
1093XWindowPtr XWindow::getWindowFromPoint(S32 screenX, S32 screenY) {
1094 XWindowPtr result;
1095
1096 iterateMappedChildrenFrontToBack([screenX, screenY, &result](const XWindowPtr& child) {
1097 if (!child->isMapped) {
1098 return true;
1099 }
1100 S32 x = screenX;
1101 S32 y = screenY;
1102
1103 child->parent->screenToWindow(x, y);
1104
1105 bool inChild = x >= child->left && x < child->left + (S32)child->width() && y >= child->top && y < child->top + (S32)child->height();
1106 XWindowPtr found = child->getWindowFromPoint(screenX, screenY);
1107 if (found && (inChild || found->isTransient())) {
1108 result = found;
1109 return false;
1110 }
1111 if ((inChild || child->isTransient())) {
1112 result = child;
1113 return false;
1114 }
1115
1116 return true;
1117 }, true);
1118 if (result) {
1119 return result;
1120 }
1121 return shared_from_this();
1122}
1123
1124void XWindow::input2Notify(const DisplayDataPtr& data, S32 dx, S32 dy, U32 type) {
1125 XEvent event = {};

Callers 7

mapWindowMethod · 0.80
unmapWindowMethod · 0.80
mouseMoveMethod · 0.80
mouseButtonMethod · 0.80
ungrabPointerMethod · 0.80
x11_TranslateCoordinatesFunction · 0.80
x11_QueryPointerFunction · 0.80

Calls 4

screenToWindowMethod · 0.80
heightMethod · 0.80
isTransientMethod · 0.80
widthMethod · 0.45

Tested by

no test coverage detected