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

Method mouseButton

source/x11/xserver.cpp:971–1005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969}
970
971void 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
1007void XServer::key(U32 key, bool pressed) {
1008 if (inputFocus) {

Callers 1

runSliceMethod · 0.45

Calls 7

windowToScreenMethod · 0.80
getInput2MaskMethod · 0.80
buttonNotifyMethod · 0.80
getWindowFromPointMethod · 0.80
screenWidthMethod · 0.45
screenHeightMethod · 0.45

Tested by

no test coverage detected