mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-21 20:26:45 +00:00
XKB: Remove a bunch of mad ifdefs
We have SEEK_SET and size_t, seriously. Also use DebugF instead of ifdef DEBUG, and ditch a couple of random bits that were never used.
This commit is contained in:
parent
0f12a448dc
commit
534fc5140b
16 changed files with 69 additions and 252 deletions
|
|
@ -813,23 +813,21 @@ XkbSrvInfoPtr xkbi;
|
|||
|
||||
xkbi= pXDev->key->xkbInfo;
|
||||
if ( pClient->xkbClientFlags & _XkbClientInitialized ) {
|
||||
#ifdef DEBUG
|
||||
if ((xkbDebugFlags&0x10)&&
|
||||
((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease)||
|
||||
(xE[0].u.u.type==DeviceKeyPress)||
|
||||
(xE[0].u.u.type == DeviceKeyRelease))) {
|
||||
ErrorF("XKbFilterWriteEvents:\n");
|
||||
ErrorF(" Event state= 0x%04x\n",xE[0].u.keyButtonPointer.state);
|
||||
ErrorF(" XkbLastRepeatEvent!=xE (0x%p!=0x%p) %s\n",
|
||||
DebugF("XKbFilterWriteEvents:\n");
|
||||
DebugF(" Event state= 0x%04x\n",xE[0].u.keyButtonPointer.state);
|
||||
DebugF(" XkbLastRepeatEvent!=xE (0x%p!=0x%p) %s\n",
|
||||
XkbLastRepeatEvent,xE,
|
||||
((XkbLastRepeatEvent!=(pointer)xE)?"True":"False"));
|
||||
ErrorF(" (xkbClientEventsFlags&XWDA)==0 (0x%x) %s\n",
|
||||
DebugF(" (xkbClientEventsFlags&XWDA)==0 (0x%x) %s\n",
|
||||
pClient->xkbClientFlags,
|
||||
(_XkbWantsDetectableAutoRepeat(pClient)?"True":"False"));
|
||||
ErrorF(" !IsRelease(%d) %s\n",xE[0].u.u.type,
|
||||
DebugF(" !IsRelease(%d) %s\n",xE[0].u.u.type,
|
||||
(!_XkbIsReleaseEvent(xE[0].u.u.type))?"True":"False");
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
if ( (XkbLastRepeatEvent==(pointer)xE) &&
|
||||
(_XkbWantsDetectableAutoRepeat(pClient)) &&
|
||||
(_XkbIsReleaseEvent(xE[0].u.u.type)) ) {
|
||||
|
|
@ -866,13 +864,11 @@ XkbSrvInfoPtr xkbi;
|
|||
if (xE[0].u.u.type == ButtonPress &&
|
||||
((xE[0].u.keyButtonPointer.state >> 7) & button_mask) == button_mask &&
|
||||
(xkbi->lockedPtrButtons & button_mask) == button_mask) {
|
||||
#ifdef DEBUG
|
||||
/* If the MouseKeys is pressed, and the "real" mouse is also pressed
|
||||
* when the mouse is released, the server does not behave properly.
|
||||
* Faking a release of the button here solves the problem.
|
||||
*/
|
||||
ErrorF("Faking release of button %d\n", xE[0].u.u.detail);
|
||||
#endif
|
||||
DebugF("Faking release of button %d\n", xE[0].u.u.detail);
|
||||
XkbDDXFakePointerButton(ButtonRelease, xE[0].u.u.detail);
|
||||
}
|
||||
}
|
||||
|
|
@ -881,21 +877,19 @@ XkbSrvInfoPtr xkbi;
|
|||
|
||||
for (i=0;i<nEvents;i++) {
|
||||
type= xE[i].u.u.type;
|
||||
#ifdef DEBUG
|
||||
if ((xkbDebugFlags&0x4)&&
|
||||
((xE[i].u.u.type==KeyPress)||(xE[i].u.u.type==KeyRelease)||
|
||||
(xE[i].u.u.type==DeviceKeyPress)||
|
||||
(xE[i].u.u.type == DeviceKeyRelease))) {
|
||||
XkbStatePtr s= &xkbi->state;
|
||||
ErrorF("XKbFilterWriteEvents (non-XKB):\n");
|
||||
ErrorF("event= 0x%04x\n",xE[i].u.keyButtonPointer.state);
|
||||
ErrorF("lookup= 0x%02x, grab= 0x%02x\n",s->lookup_mods,
|
||||
DebugF("XKbFilterWriteEvents (non-XKB):\n");
|
||||
DebugF("event= 0x%04x\n",xE[i].u.keyButtonPointer.state);
|
||||
DebugF("lookup= 0x%02x, grab= 0x%02x\n",s->lookup_mods,
|
||||
s->grab_mods);
|
||||
ErrorF("compat lookup= 0x%02x, grab= 0x%02x\n",
|
||||
DebugF("compat lookup= 0x%02x, grab= 0x%02x\n",
|
||||
s->compat_lookup_mods,
|
||||
s->compat_grab_mods);
|
||||
}
|
||||
#endif
|
||||
if ( (type>=KeyPress)&&(type<=MotionNotify) ) {
|
||||
CARD16 old,new;
|
||||
|
||||
|
|
@ -924,16 +918,12 @@ XkbSrvInfoPtr xkbi;
|
|||
if (type == ButtonPress &&
|
||||
((xE[i].u.keyButtonPointer.state >> 7) & button_mask) == button_mask &&
|
||||
(xkbi->lockedPtrButtons & button_mask) == button_mask) {
|
||||
#ifdef DEBUG
|
||||
ErrorF("Faking release of button %d\n", xE[i].u.u.detail);
|
||||
#endif
|
||||
DebugF("Faking release of button %d\n", xE[i].u.u.detail);
|
||||
XkbDDXFakePointerButton(ButtonRelease, xE[i].u.u.detail);
|
||||
} else if (type == DeviceButtonPress &&
|
||||
((((deviceKeyButtonPointer*)&xE[i])->state >> 7) & button_mask) == button_mask &&
|
||||
(xkbi->lockedPtrButtons & button_mask) == button_mask) {
|
||||
#ifdef DEBUG
|
||||
ErrorF("Faking release of button %d\n", ((deviceKeyButtonPointer*)&xE[i])->state);
|
||||
#endif
|
||||
DebugF("Faking release of button %d\n", ((deviceKeyButtonPointer*)&xE[i])->state);
|
||||
XkbDDXFakePointerButton(DeviceButtonRelease, ((deviceKeyButtonPointer*)&xE[i])->state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue