From c9562bed0d5e26b7e3e55e26cf1ddc5086d61cc6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 1 Aug 2011 09:52:38 +1000 Subject: dix: rename mieqSwitchScreen argument fromDix → set_dequeue_screen, document MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fromDIX is neither exactly true nor particularly helpful in understanding what this parameter triggers. Rename to set_dequeue_screen, because that's exactly what happens. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone --- mi/mi.h | 2 +- mi/mieq.c | 19 +++++++++++++++++-- mi/mipointer.h | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) (limited to 'mi') diff --git a/mi/mi.h b/mi/mi.h index c186940ff..24d1af911 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -206,7 +206,7 @@ extern _X_EXPORT void mieqEnqueue( extern _X_EXPORT void mieqSwitchScreen( DeviceIntPtr /* pDev */, ScreenPtr /*pScreen*/, - Bool /*fromDIX*/ + Bool /*set_dequeue_screen*/ ); extern _X_EXPORT void mieqProcessDeviceEvent( diff --git a/mi/mieq.c b/mi/mieq.c index fc3738a41..b75bde9de 100644 --- a/mi/mieq.c +++ b/mi/mieq.c @@ -209,14 +209,29 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) #endif } +/** + * Changes the screen reference events are being enqueued from. + * Input events are enqueued with a screen reference and dequeued and + * processed with a (potentially different) screen reference. + * This function is called whenever a new event has changed screen but is + * still logically on the previous screen as seen by the client. + * This usually happens whenever the visible cursor moves across screen + * boundaries during event generation, before the same event is processed + * and sent down the wire. + * + * @param pDev The device that triggered a screen change. + * @param pScreen The new screen events are being enqueued for. + * @param set_dequeue_screen If TRUE, pScreen is set as both enqueue screen + * and dequeue screen. + */ void -mieqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX) +mieqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool set_dequeue_screen) { #ifdef XQUARTZ pthread_mutex_lock(&miEventQueueMutex); #endif EnqueueScreen(pDev) = pScreen; - if (fromDIX) + if (set_dequeue_screen) DequeueScreen(pDev) = pScreen; #ifdef XQUARTZ pthread_mutex_unlock(&miEventQueueMutex); diff --git a/mi/mipointer.h b/mi/mipointer.h index 539096e78..c4265f9d8 100644 --- a/mi/mipointer.h +++ b/mi/mipointer.h @@ -87,7 +87,7 @@ typedef struct _miPointerScreenFuncRec { void (*NewEventScreen)( DeviceIntPtr /* pDev */, ScreenPtr /* pScr */, - Bool /* fromDIX */ + Bool /* set_dequeue_screen */ ); } miPointerScreenFuncRec, *miPointerScreenFuncPtr; -- cgit v1.2.3 From b3c76b0c53ac42b70d12849da18465e8467e474c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 1 Aug 2011 11:54:17 +1000 Subject: mi: fix comment typo, whitespace in miPointerSetPosition Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone --- mi/mipointer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mi') diff --git a/mi/mipointer.c b/mi/mipointer.c index 7680ca19b..670f63b6e 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -569,9 +569,9 @@ miPointerMoveNoEvent (DeviceIntPtr pDev, ScreenPtr pScreen, * * @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 + * @param[in,out] x The x coordinate in screen coordinates (in regards to total * desktop size) - * @param[in,out] y The y coordiante in screen coordinates (in regards to total + * @param[in,out] y The y coordinate in screen coordinates (in regards to total * desktop size) */ void @@ -603,7 +603,7 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y) pScreen = newScreen; (*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, FALSE); - /* Smash the confine to the new screen */ + /* Smash the confine to the new screen */ pPointer->limits.x2 = pScreen->width; pPointer->limits.y2 = pScreen->height; } @@ -622,8 +622,8 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y) if (pScreen->ConstrainCursorHarder) pScreen->ConstrainCursorHarder(pDev, pScreen, mode, x, y); - if (pPointer->x == *x && pPointer->y == *y && - pPointer->pScreen == pScreen) + if (pPointer->x == *x && pPointer->y == *y && + pPointer->pScreen == pScreen) return; miPointerMoveNoEvent(pDev, pScreen, *x, *y); -- cgit v1.2.3 From 6fd2adc179141310e45a56ee90ef5b5f6115a1f6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 1 Aug 2011 14:27:54 +1000 Subject: mi: fix compiler warnings ("foo" set but not used) misprite.c: In function 'miSpriteSaveUnderCursor': misprite.c:940:12: warning: variable 'y' set but not used [-Wunused-but-set-variable] misprite.c:940:9: warning: variable 'x' set but not used [-Wunused-but-set-variable] mivaltree.c: In function 'miComputeClips': mivaltree.c:226:10: warning: variable 'resized' set but not used [-Wunused-but-set-variable] Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone --- mi/misprite.c | 5 ----- mi/mivaltree.c | 2 -- 2 files changed, 7 deletions(-) (limited to 'mi') diff --git a/mi/misprite.c b/mi/misprite.c index 1cfcdf6ee..1025c5a6f 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -937,8 +937,6 @@ static void miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv; - int x, y; - CursorPtr pCursor; miCursorInfoPtr pCursorInfo; if (IsFloating(pDev)) @@ -949,10 +947,7 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen) pCursorInfo = MISPRITE(pDev); miSpriteComputeSaved (pDev, pScreen); - pCursor = pCursorInfo->pCursor; - x = pCursorInfo->x - (int)pCursor->bits->xhot; - y = pCursorInfo->y - (int)pCursor->bits->yhot; miSpriteDisableDamage(pScreen, pScreenPriv); miDCSaveUnderCursor(pDev, diff --git a/mi/mivaltree.c b/mi/mivaltree.c index 0e00c2fb5..e1d47c06f 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -223,7 +223,6 @@ miComputeClips ( RegionRec childUnion; Bool overlap; RegionPtr borderVisible; - Bool resized; /* * Figure out the new visibility of this window. * The extent of the universe should be the same as the extent of @@ -378,7 +377,6 @@ miComputeClips ( } borderVisible = pParent->valdata->before.borderVisible; - resized = pParent->valdata->before.resized; RegionNull(&pParent->valdata->after.borderExposed); RegionNull(&pParent->valdata->after.exposed); -- cgit v1.2.3