checkpoint clean-up
This commit is contained in:
parent
0f873a9d4f
commit
44eb15adee
|
@ -242,11 +242,7 @@ static int dmxBackendOffscreen(int screen, int x, int y)
|
||||||
void dmxBackendUpdatePosition(pointer private, int x, int y)
|
void dmxBackendUpdatePosition(pointer private, int x, int y)
|
||||||
{
|
{
|
||||||
GETPRIVFROMPRIVATE;
|
GETPRIVFROMPRIVATE;
|
||||||
#if 00 /*BP*/
|
|
||||||
int screen = miPointerCurrentScreen()->myNum;
|
|
||||||
#else
|
|
||||||
int screen = miPointerGetScreen(inputInfo.pointer)->myNum;
|
int screen = miPointerGetScreen(inputInfo.pointer)->myNum;
|
||||||
#endif
|
|
||||||
DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen];
|
DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen];
|
||||||
int oldRelative = priv->relative;
|
int oldRelative = priv->relative;
|
||||||
int topscreen = dmxBackendFindOverlapping(priv, screen, x, y);
|
int topscreen = dmxBackendFindOverlapping(priv, screen, x, y);
|
||||||
|
@ -397,7 +393,6 @@ void dmxBackendCollectEvents(DevicePtr pDev,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
#if 001 /*BP*/
|
|
||||||
DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)"
|
DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)"
|
||||||
" newscreen=%d: %d %d (e=%d; last=%d,%d)\n",
|
" newscreen=%d: %d %d (e=%d; last=%d,%d)\n",
|
||||||
dmxScreen->index, priv->myScreen,
|
dmxScreen->index, priv->myScreen,
|
||||||
|
@ -451,25 +446,15 @@ void dmxBackendCollectEvents(DevicePtr pDev,
|
||||||
(dmxScreen->rootYOrigin + X.xmotion.y
|
(dmxScreen->rootYOrigin + X.xmotion.y
|
||||||
- dmxScreen->rootY));
|
- dmxScreen->rootY));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
/*
|
|
||||||
ErrorF("motion %d, %d, %d\n",
|
|
||||||
X.xmotion.x, X.xmotion.y, X.xmotion.state);
|
|
||||||
*/
|
|
||||||
enqueue(priv->mou, X.type, 0/*X.xbutton.button*/, 0, &X, block);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
enqueue(priv->kbd, X.type, X.xkey.keycode, 0, NULL, block);
|
enqueue(priv->kbd, X.type, X.xkey.keycode, 0, NULL, block);
|
||||||
break;
|
break;
|
||||||
#if 11/*BP*/
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
ErrorF("press/release at %d, %d\n", X.xbutton.x, X.xbutton.y);
|
/* fall-through */
|
||||||
/* fall-through */
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
/* Pass the whole event here, because
|
/* Pass the whole event here, because
|
||||||
* this may be an extension event. */
|
* this may be an extension event. */
|
||||||
|
|
|
@ -194,30 +194,20 @@ DMXScreenInfo *dmxFindFirstScreen(int x, int y)
|
||||||
|
|
||||||
#if 11/*BP*/
|
#if 11/*BP*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enqueue a motion event.
|
||||||
|
*/
|
||||||
static void enqueueMotion(DevicePtr pDev, int x, int y)
|
static void enqueueMotion(DevicePtr pDev, int x, int y)
|
||||||
{
|
{
|
||||||
GETDMXINPUTFROMPDEV;
|
GETDMXLOCALFROMPDEV;
|
||||||
DeviceIntPtr p = dmxLocal->pDevice;
|
DeviceIntPtr p = dmxLocal->pDevice;
|
||||||
int i, nevents, valuators[3];
|
int i, nevents, valuators[3];
|
||||||
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
||||||
int detail = 0;
|
int detail = 0; /* XXX should this be mask of pressed buttons? */
|
||||||
|
|
||||||
valuators[0] = x;
|
valuators[0] = x;
|
||||||
valuators[1] = y;
|
valuators[1] = y;
|
||||||
valuators[2] = detail;
|
nevents = GetPointerEvents(events, p, MotionNotify, detail,
|
||||||
nevents = GetPointerEvents(events,
|
POINTER_ABSOLUTE, 0, 2, valuators);
|
||||||
/*pDev*/p,
|
|
||||||
MotionNotify,
|
|
||||||
detail,
|
|
||||||
POINTER_ABSOLUTE,
|
|
||||||
0, 2, valuators);
|
|
||||||
ErrorF("MOTION2 %d, %d n = %d\n", valuators[0], valuators[1], nevents);
|
|
||||||
/*
|
|
||||||
ErrorF("NEW MOTION %d st %d (%d,%d,%d) n=%d\n",
|
|
||||||
detail, e->xmotion.state,
|
|
||||||
valuators[0], valuators[1], valuators[2],
|
|
||||||
nevents);
|
|
||||||
*/
|
|
||||||
for (i = 0; i < nevents; i++)
|
for (i = 0; i < nevents; i++)
|
||||||
mieqEnqueue(p, events + i);
|
mieqEnqueue(p, events + i);
|
||||||
xfree(events);
|
xfree(events);
|
||||||
|
@ -347,8 +337,6 @@ void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
|
||||||
if (dmxGlobalX >= dmxGlobalWidth) dmxGlobalX = dmxGlobalWidth + delta -1;
|
if (dmxGlobalX >= dmxGlobalWidth) dmxGlobalX = dmxGlobalWidth + delta -1;
|
||||||
if (dmxGlobalY >= dmxGlobalHeight) dmxGlobalY = dmxGlobalHeight + delta -1;
|
if (dmxGlobalY >= dmxGlobalHeight) dmxGlobalY = dmxGlobalHeight + delta -1;
|
||||||
|
|
||||||
ErrorF("Global Pos: %d, %d\n", dmxGlobalX, dmxGlobalY);
|
|
||||||
|
|
||||||
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
|
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
|
||||||
localX = dmxGlobalX - dmxScreen->rootXOrigin;
|
localX = dmxGlobalX - dmxScreen->rootXOrigin;
|
||||||
localY = dmxGlobalY - dmxScreen->rootYOrigin;
|
localY = dmxGlobalY - dmxScreen->rootYOrigin;
|
||||||
|
@ -397,7 +385,6 @@ void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
|
||||||
#endif
|
#endif
|
||||||
dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
|
dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
|
||||||
dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
|
dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
|
||||||
ErrorF("Global is now %d, %d\n", dmxGlobalX, dmxGlobalY);
|
|
||||||
DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
|
DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
|
||||||
" on screen index=%d/%d localX=%d localY=%d\n",
|
" on screen index=%d/%d localX=%d localY=%d\n",
|
||||||
dmxGlobalX, dmxGlobalY,
|
dmxGlobalX, dmxGlobalY,
|
||||||
|
@ -750,7 +737,7 @@ static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym)
|
||||||
return keyCode ? keyCode : detail;
|
return keyCode ? keyCode : detail;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Enqueue a non-motion event from the \a pDev device with the
|
/** Enqueue an event from the \a pDev device with the
|
||||||
* specified \a type and \a detail. If the event is a KeyPress or
|
* specified \a type and \a detail. If the event is a KeyPress or
|
||||||
* KeyRelease event, then the \a keySym is also specified.
|
* KeyRelease event, then the \a keySym is also specified.
|
||||||
*
|
*
|
||||||
|
@ -778,10 +765,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
|
||||||
DeviceIntPtr p = dmxLocal->pDevice;
|
DeviceIntPtr p = dmxLocal->pDevice;
|
||||||
int i, nevents;
|
int i, nevents;
|
||||||
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
||||||
nevents = GetKeyboardEvents(events,
|
nevents = GetKeyboardEvents(events, p, type, detail);
|
||||||
/*pDev*/p,
|
|
||||||
/*KeyPress*/type,
|
|
||||||
/*n*/detail);
|
|
||||||
ErrorF("KEY %d n=%d\n", detail, nevents);
|
ErrorF("KEY %d n=%d\n", detail, nevents);
|
||||||
for (i = 0; i < nevents; i++)
|
for (i = 0; i < nevents; i++)
|
||||||
mieqEnqueue(p, events + i);
|
mieqEnqueue(p, events + i);
|
||||||
|
@ -795,6 +779,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
|
||||||
#if 00 /*BP*/
|
#if 00 /*BP*/
|
||||||
detail = dmxGetButtonMapping(dmxLocal, detail);
|
detail = dmxGetButtonMapping(dmxLocal, detail);
|
||||||
#else
|
#else
|
||||||
|
detail = dmxGetButtonMapping(dmxLocal, detail);
|
||||||
{
|
{
|
||||||
DeviceIntPtr p = dmxLocal->pDevice;
|
DeviceIntPtr p = dmxLocal->pDevice;
|
||||||
int i, nevents, valuators[3];
|
int i, nevents, valuators[3];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user