| 969 | } |
| 970 | |
| 971 | void XServer::mouseButton(U32 button, S32 x, S32 y, bool pressed) { |
| 972 | if (fakeFullScreenWnd) { |
| 973 | fakeFullScreenWnd->windowToScreen(x, y); |
| 974 | } |
| 975 | if (isGrabbed) { |
| 976 | BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(grabbedMutex); |
| 977 | XWindowPtr grabbed = getWindow(grabbedId); |
| 978 | DisplayDataPtr grabbedDisplay = getDisplayDataById(grabbedDisplayId); |
| 979 | |
| 980 | if (grabbed && grabbedDisplay) { |
| 981 | U32 mask = pressed ? ButtonPressMask : ButtonReleaseMask; |
| 982 | if (!(grabbedMask & mask)) { |
| 983 | return; |
| 984 | } |
| 985 | if ((grabbedDisplay->getInput2Mask(root->id) & XI_RawMotionMask) && KSystem::forceRelativeMouse) { |
| 986 | KNativeInputPtr input = KNativeSystem::getCurrentInput(); |
| 987 | S32 midX = input->screenWidth() / 2; |
| 988 | S32 midY = input->screenHeight() / 2; |
| 989 | x = 0; |
| 990 | y = 0; |
| 991 | KNativeSystem::warpMouse(midX, midY); |
| 992 | } |
| 993 | grabbed->buttonNotify(grabbedDisplay, button, x, y, pressed); |
| 994 | return; |
| 995 | } else { |
| 996 | ungrabPointer(0); |
| 997 | } |
| 998 | } |
| 999 | if (root) { // might not be set at the very start |
| 1000 | XWindowPtr wnd = root->getWindowFromPoint(x, y); |
| 1001 | while (wnd && !wnd->mouseButtonScreenCoords(button, x, y, pressed)) { |
| 1002 | wnd = wnd->parent; |
| 1003 | } |
| 1004 | } |
| 1005 | } |
| 1006 | |
| 1007 | void XServer::key(U32 key, bool pressed) { |
| 1008 | if (inputFocus) { |
no test coverage detected