aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/randr/rrpointer.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-07-25 19:39:46 +0000
committermarha <marha@users.sourceforge.net>2009-07-25 19:39:46 +0000
commit4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (patch)
treec1e02b9d3509aa97703aa4b540d4cd22ec4600ed /xorg-server/randr/rrpointer.c
parentdc3c299dd0995549e2a6973ca0f25b254afd38a5 (diff)
downloadvcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.gz
vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.bz2
vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.zip
Added xorg-server-1.6.2.tar.gz
Diffstat (limited to 'xorg-server/randr/rrpointer.c')
-rw-r--r--xorg-server/randr/rrpointer.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/xorg-server/randr/rrpointer.c b/xorg-server/randr/rrpointer.c
index c88a0f83e..6b934c0c6 100644
--- a/xorg-server/randr/rrpointer.c
+++ b/xorg-server/randr/rrpointer.c
@@ -21,6 +21,7 @@
*/
#include "randrstr.h"
+#include "inputstr.h"
/*
* When the pointer moves, check to see if the specified position is outside
@@ -51,7 +52,7 @@ RRCrtcContainsPosition (RRCrtcPtr crtc, int x, int y)
* Find the CRTC nearest the specified position, ignoring 'skip'
*/
static void
-RRPointerToNearestCrtc (ScreenPtr pScreen, int x, int y, RRCrtcPtr skip)
+RRPointerToNearestCrtc (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, RRCrtcPtr skip)
{
rrScrPriv (pScreen);
int c;
@@ -95,7 +96,7 @@ RRPointerToNearestCrtc (ScreenPtr pScreen, int x, int y, RRCrtcPtr skip)
}
}
if (best_dx || best_dy)
- (*pScreen->SetCursorPosition) (pScreen, x + best_dx, y + best_dy, TRUE);
+ (*pScreen->SetCursorPosition) (pDev, pScreen, x + best_dx, y + best_dy, TRUE);
pScrPriv->pointerCrtc = nearest;
}
@@ -124,22 +125,34 @@ RRPointerMoved (ScreenPtr pScreen, int x, int y)
}
/* None contain pointer, find nearest */
- RRPointerToNearestCrtc (pScreen, x, y, pointerCrtc);
+ ErrorF("RRPointerMoved: Untested, may cause \"bogus pointer event\"\n");
+ RRPointerToNearestCrtc (inputInfo.pointer, pScreen, x, y, pointerCrtc);
}
/*
- * When the screen is reconfigured, move the pointer to the nearest
+ * When the screen is reconfigured, move all pointers to the nearest
* CRTC
*/
void
RRPointerScreenConfigured (ScreenPtr pScreen)
{
- WindowPtr pRoot = GetCurrentRootWindow ();
- ScreenPtr pCurrentScreen = pRoot ? pRoot->drawable.pScreen : NULL;
+ WindowPtr pRoot;
+ ScreenPtr pCurrentScreen;
int x, y;
+ DeviceIntPtr pDev;
- if (pScreen != pCurrentScreen)
- return;
- GetSpritePosition (&x, &y);
- RRPointerToNearestCrtc (pScreen, x, y, NULL);
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ {
+ if (IsPointerDevice(pDev))
+ {
+ pRoot = GetCurrentRootWindow(pDev);
+ pCurrentScreen = pRoot ? pRoot->drawable.pScreen : NULL;
+
+ if (pScreen == pCurrentScreen)
+ {
+ GetSpritePosition(pDev, &x, &y);
+ RRPointerToNearestCrtc (pDev, pScreen, x, y, NULL);
+ }
+ }
+ }
}