diff options
author | marha <marha@users.sourceforge.net> | 2013-01-07 11:56:06 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-01-07 11:56:06 +0100 |
commit | 3f553aaceddc9b09363c73d9bea40eaea8164fc4 (patch) | |
tree | b112d1ad761f8621106f8930daaf97fafed339fb /xorg-server/mi | |
parent | 293fd0043af7e861c9c540bebc44630d0da0bf9b (diff) | |
download | vcxsrv-3f553aaceddc9b09363c73d9bea40eaea8164fc4.tar.gz vcxsrv-3f553aaceddc9b09363c73d9bea40eaea8164fc4.tar.bz2 vcxsrv-3f553aaceddc9b09363c73d9bea40eaea8164fc4.zip |
pixman xkbcomp libX11 libXau mesa fontconfig xserver xkeyboard-config git update 7 jan 2013
fontconfig: 17eda89ed2e24a3fc5f68538dd7fd9ada8efb087
xserver: bd91b05b631f13afd1f7a9d6cbc4f0c5408b523a
xkeyboard-config: 4779e2745094ebe0c06364b4099d7067ae750d07
libX11: cd25cab4b5b957641183ce72dd1ae0424aff1663
libXau: e04364efccbb3bb4cfc5f4cb491ffa1faaaacbdb
mesa: afec10df373f342f058aab66c622237964a4a147
pixman: 35cc965514ca6e665c18411fcf66db826d559c2a
xkbcomp: e4f767913338052527538d429931e8abd8c3fb88
Diffstat (limited to 'xorg-server/mi')
-rw-r--r-- | xorg-server/mi/mieq.c | 4 | ||||
-rw-r--r-- | xorg-server/mi/miinitext.c | 9 | ||||
-rw-r--r-- | xorg-server/mi/mipointer.c | 54 | ||||
-rw-r--r-- | xorg-server/mi/mipointer.h | 3 |
4 files changed, 56 insertions, 14 deletions
diff --git a/xorg-server/mi/mieq.c b/xorg-server/mi/mieq.c index b2c7769ec..22f8c91bb 100644 --- a/xorg-server/mi/mieq.c +++ b/xorg-server/mi/mieq.c @@ -407,6 +407,10 @@ ChangeDeviceID(DeviceIntPtr dev, InternalEvent *event) case ET_RawTouchUpdate: event->raw_event.deviceid = dev->id; break; + case ET_BarrierHit: + case ET_BarrierLeave: + event->barrier_event.deviceid = dev->id; + break; default: ErrorF("[mi] Unknown event type (%d), cannot change id.\n", event->any.type); diff --git a/xorg-server/mi/miinitext.c b/xorg-server/mi/miinitext.c index 369da5ede..81c663abe 100644 --- a/xorg-server/mi/miinitext.c +++ b/xorg-server/mi/miinitext.c @@ -212,10 +212,12 @@ EnableDisableExtension(const char *name, Bool enable) void EnableDisableExtensionError(const char *name, Bool enable) { - ExtensionToggle *ext = &ExtensionToggleList[0]; + ExtensionToggle *ext; + int i; Bool found = FALSE; - for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) { + for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { + ext = &ExtensionToggleList[i]; if ((strcmp(name, ext->name) == 0) && (ext->disablePtr == NULL)) { ErrorF("[mi] Extension \"%s\" can not be disabled\n", name); found = TRUE; @@ -226,7 +228,8 @@ EnableDisableExtensionError(const char *name, Bool enable) ErrorF("[mi] Extension \"%s\" is not recognized\n", name); ErrorF("[mi] Only the following extensions can be run-time %s:\n", enable ? "enabled" : "disabled"); - for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) { + for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { + ext = &ExtensionToggleList[i]; if (ext->disablePtr != NULL) { ErrorF("[mi] %s\n", ext->name); } diff --git a/xorg-server/mi/mipointer.c b/xorg-server/mi/mipointer.c index f34506326..b8503f450 100644 --- a/xorg-server/mi/mipointer.c +++ b/xorg-server/mi/mipointer.c @@ -98,7 +98,7 @@ static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen); static void miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); -static InternalEvent *events; /* for WarpPointer MotionNotifies */ +static InternalEvent *mipointermove_events; /* for WarpPointer MotionNotifies */ Bool miPointerInitialize(ScreenPtr pScreen, @@ -143,7 +143,7 @@ miPointerInitialize(ScreenPtr pScreen, pScreen->DeviceCursorInitialize = miPointerDeviceInitialize; pScreen->DeviceCursorCleanup = miPointerDeviceCleanup; - events = NULL; + mipointermove_events = NULL; return TRUE; } @@ -160,8 +160,8 @@ miPointerCloseScreen(ScreenPtr pScreen) pScreen->CloseScreen = pScreenPriv->CloseScreen; free((pointer) pScreenPriv); - FreeEventList(events, GetMaximumEventsNum()); - events = NULL; + FreeEventList(mipointermove_events, GetMaximumEventsNum()); + mipointermove_events = NULL; return (*pScreen->CloseScreen) (pScreen); } @@ -565,13 +565,16 @@ miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) */ ScreenPtr miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, - double *screeny) + double *screeny, + int *nevents, InternalEvent* events) { miPointerScreenPtr pScreenPriv; ScreenPtr pScreen; ScreenPtr newScreen; int x, y; Bool switch_screen = FALSE; + Bool should_constrain_barriers = FALSE; + int i; miPointerPtr pPointer; @@ -588,6 +591,25 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, x -= pScreen->x; y -= pScreen->y; + should_constrain_barriers = (mode == Relative); + + if (should_constrain_barriers) { + /* coordinates after clamped to a barrier */ + int constrained_x, constrained_y; + int current_x, current_y; /* current position in per-screen coord */ + + current_x = MIPOINTER(pDev)->x - pScreen->y; + current_y = MIPOINTER(pDev)->y - pScreen->x; + + input_constrain_cursor(pDev, pScreen, + current_x, current_y, x, y, + &constrained_x, &constrained_y, + nevents, events); + + x = constrained_x; + y = constrained_y; + } + if (switch_screen) { pScreenPriv = GetScreenPrivate(pScreen); if (!pPointer->confined) { @@ -619,6 +641,18 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, if (pPointer->x != x || pPointer->y != y || pPointer->pScreen != pScreen) miPointerMoveNoEvent(pDev, pScreen, x, y); + /* check if we generated any barrier events and if so, update root x/y + * to the fully constrained coords */ + if (should_constrain_barriers) { + for (i = 0; i < *nevents; i++) { + if (events[i].any.type == ET_BarrierHit || + events[i].any.type == ET_BarrierLeave) { + events[i].barrier_event.root_x = x; + events[i].barrier_event.root_y = y; + } + } + } + /* Convert to desktop coordinates again */ x += pScreen->x; y += pScreen->y; @@ -676,17 +710,17 @@ miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) valuators[0] = x; valuators[1] = y; - if (!events) { - events = InitEventList(GetMaximumEventsNum()); + if (!mipointermove_events) { + mipointermove_events = InitEventList(GetMaximumEventsNum()); - if (!events) { + if (!mipointermove_events) { FatalError("Could not allocate event store.\n"); return; } } valuator_mask_set_range(&mask, 0, 2, valuators); - nevents = GetPointerEvents(events, pDev, MotionNotify, 0, + nevents = GetPointerEvents(mipointermove_events, pDev, MotionNotify, 0, POINTER_SCREEN | POINTER_ABSOLUTE | POINTER_NORAW, &mask); @@ -695,7 +729,7 @@ miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) darwinEvents_lock(); #endif for (i = 0; i < nevents; i++) - mieqEnqueue(pDev, &events[i]); + mieqEnqueue(pDev, &mipointermove_events[i]); #ifdef XQUARTZ darwinEvents_unlock(); #endif diff --git a/xorg-server/mi/mipointer.h b/xorg-server/mi/mipointer.h index 1500e216a..f89dff31e 100644 --- a/xorg-server/mi/mipointer.h +++ b/xorg-server/mi/mipointer.h @@ -115,7 +115,8 @@ miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y); /* Moves the cursor to the specified position. May clip the co-ordinates: * x and y are modified in-place. */ extern _X_EXPORT ScreenPtr -miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y); +miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y, + int *nevents, InternalEvent *events); extern _X_EXPORT void miPointerUpdateSprite(DeviceIntPtr pDev); |