Add mode field to pointer movement hooks.

Preparation work for pointer barriers.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2011-02-18 14:19:18 +10:00 committed by Adam Jackson
parent 92788e677b
commit 769531b9cc
3 changed files with 15 additions and 4 deletions

View File

@ -812,7 +812,11 @@ accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms)
* miPointerSetPosition() and then scale back into device coordinates (if
* needed). miPSP will change x/y if the screen was crossed.
*
* The coordinates provided are always absolute. The parameter mode whether
* it was relative or absolute movement that landed us at those coordinates.
*
* @param dev The device to be moved.
* @param mode Movement mode (Absolute or Relative)
* @param x Pointer to current x-axis value, may be modified.
* @param y Pointer to current y-axis value, may be modified.
* @param x_frac Fractional part of current x-axis value, may be modified.
@ -824,7 +828,8 @@ accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms)
* @param screeny_frac Fractional part of screen y coordinate, as above.
*/
static void
positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
positionSprite(DeviceIntPtr dev, int mode,
int *x, int *y, float x_frac, float y_frac,
ScreenPtr scr, int *screenx, int *screeny, float *screenx_frac, float *screeny_frac)
{
int old_screenx, old_screeny;
@ -863,7 +868,7 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
old_screeny = *screeny;
/* This takes care of crossing screens for us, as well as clipping
* to the current screen. */
miPointerSetPosition(dev, screenx, screeny);
miPointerSetPosition(dev, mode, screenx, screeny);
if(!IsMaster(dev) || !IsFloating(dev)) {
DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
@ -1194,7 +1199,8 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
set_raw_valuators(raw, &mask, raw->valuators.data);
positionSprite(pDev, &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac);
positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
&x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac);
updateHistory(pDev, &mask, ms);
/* Update the valuators with the true value sent to the client*/

View File

@ -560,14 +560,18 @@ miPointerMoveNoEvent (DeviceIntPtr pDev, ScreenPtr pScreen,
* This function is called during the pointer update path in
* GetPointerEvents and friends (and the same in the xwin DDX).
*
* The coordinates provided are always absolute. The parameter mode whether
* it was relative or absolute movement that landed us at those coordinates.
*
* @param pDev The device to move
* @param mode Movement mode (Absolute or Relative)
* @param[in,out] x The x coordiante in screen coordinates (in regards to total
* desktop size)
* @param[in,out] y The y coordiante in screen coordinates (in regards to total
* desktop size)
*/
void
miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y)
{
miPointerScreenPtr pScreenPriv;
ScreenPtr pScreen;

View File

@ -133,6 +133,7 @@ extern _X_EXPORT void miPointerGetPosition(
* x and y are modified in-place. */
extern _X_EXPORT void miPointerSetPosition(
DeviceIntPtr pDev,
int mode,
int *x,
int *y);