| 1091 | } |
| 1092 | |
| 1093 | XWindowPtr 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 | |
| 1124 | void XWindow::input2Notify(const DisplayDataPtr& data, S32 dx, S32 dy, U32 type) { |
| 1125 | XEvent event = {}; |
no test coverage detected