Index: external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/bsd_mouse.c =================================================================== RCS file: /cvsroot/xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/bsd_mouse.c,v retrieving revision 1.5 diff -u -r1.5 bsd_mouse.c --- external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/bsd_mouse.c 9 Feb 2009 09:49:39 -0000 1.5 +++ external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/bsd_mouse.c 4 Mar 2009 06:44:06 -0000 @@ -406,6 +406,38 @@ #endif /* __OpenBSD__ && WSCONS_SUPPORT */ #ifdef WSCONS_SUPPORT +static void +wsconsFlushAbsEvents(InputInfoPtr pInfo, int absX, int absY, + Bool *absXset, Bool *absYset) +{ +#ifdef DEBUG + ErrorF("vuidFlushAbsEvents: %d,%d (set: %d, %d)\n", + absX, absY, *absXset, *absYset); +#endif + if ((*absXset) && (*absYset)) { + xf86PostMotionEvent(pInfo->dev, + /* is_absolute: */ TRUE, + /* first_valuator: */ 0, + /* num_valuators: */ 2, + absX, absY); + } else if (*absXset) { + xf86PostMotionEvent(pInfo->dev, + /* is_absolute: */ TRUE, + /* first_valuator: */ 0, + /* num_valuators: */ 1, + absX); + } else if (*absYset) { + xf86PostMotionEvent(pInfo->dev, + /* is_absolute: */ TRUE, + /* first_valuator: */ 1, + /* num_valuators: */ 1, + absY); + } + + *absXset = FALSE; + *absYset = FALSE; +} + #define NUMEVENTS 64 static void @@ -416,6 +448,8 @@ int n, c; struct wscons_event *event = eventList; unsigned char *pBuf; + int absX, absY; + Bool absXset = FALSE, absYset = FALSE; pMse = pInfo->private; @@ -457,6 +491,24 @@ dw = event->value; break; #endif + case WSCONS_EVENT_MOUSE_ABSOLUTE_X: + if (absXset) { + wsconsFlushAbsEvents(pInfo, absX, absY, &absXset, &absYset); + } + absX = event->value; + absXset = TRUE; + ++event; + continue; /* In this case, it is not necessary to post a event */ + + case WSCONS_EVENT_MOUSE_ABSOLUTE_Y: + if (absYset) { + wsconsFlushAbsEvents(pInfo, absX, absY, &absXset, &absYset); + } + absY = event->value; + absYset = TRUE; + ++event; + continue; /* In this case, it is not necessary to post a event */ + default: xf86Msg(X_WARNING, "%s: bad wsmouse event type=%d\n", pInfo->name, event->type); @@ -467,6 +519,9 @@ pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw); ++event; } + if (absXset || absYset) { + wsconsFlushAbsEvents(pInfo, absX, absY, &absXset, &absYset); + } return; }