aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86RandR.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-04 15:38:04 +0000
committermarha <marha@users.sourceforge.net>2011-03-04 15:38:04 +0000
commit3592ad31cfc72ffff3c9024eecea7d3b987c7954 (patch)
tree0e3b50cb6bcd0839b591d318a41d04b7cbd8e6e2 /xorg-server/hw/xfree86/common/xf86RandR.c
parent79409465b0b8d5d38e6b94deb1943316f40c66eb (diff)
parent0a5888393c68f6f7db86206d1f277232db18240b (diff)
downloadvcxsrv-3592ad31cfc72ffff3c9024eecea7d3b987c7954.tar.gz
vcxsrv-3592ad31cfc72ffff3c9024eecea7d3b987c7954.tar.bz2
vcxsrv-3592ad31cfc72ffff3c9024eecea7d3b987c7954.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86RandR.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86RandR.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86RandR.c b/xorg-server/hw/xfree86/common/xf86RandR.c
index 3bd15e059..e8e5a3696 100644
--- a/xorg-server/hw/xfree86/common/xf86RandR.c
+++ b/xorg-server/hw/xfree86/common/xf86RandR.c
@@ -242,11 +242,20 @@ xf86RandRSetConfig (ScreenPtr pScreen,
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
DisplayModePtr mode;
- int px, py;
+ int pos[MAXDEVICES][2];
Bool useVirtual = FALSE;
Rotation oldRotation = randrp->rotation;
+ DeviceIntPtr dev;
+ Bool view_adjusted = FALSE;
+
+ for (dev = inputInfo.devices; dev; dev = dev->next)
+ {
+ if (!IsMaster(dev) && !IsFloating(dev))
+ continue;
+
+ miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]);
+ }
- miPointerGetPosition(inputInfo.pointer, &px, &py);
for (mode = scrp->modes; ; mode = mode->next)
{
if (mode->HDisplay == pSize->width &&
@@ -303,17 +312,31 @@ xf86RandRSetConfig (ScreenPtr pScreen,
}
return FALSE;
}
+
/*
* Move the cursor back where it belongs; SwitchMode repositions it
+ * FIXME: duplicated code, see modes/xf86RandR12.c
*/
- if (pScreen == miPointerCurrentScreen ())
+ for (dev = inputInfo.devices; dev; dev = dev->next)
{
- px = (px >= pScreen->width ? (pScreen->width - 1) : px);
- py = (py >= pScreen->height ? (pScreen->height - 1) : py);
+ if (!IsMaster(dev) && !IsFloating(dev))
+ continue;
- xf86SetViewport(pScreen, px, py);
+ if (pScreen == miPointerGetScreen(dev)) {
+ int px = pos[dev->id][0];
+ int py = pos[dev->id][1];
- (*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE);
+ px = (px >= pScreen->width ? (pScreen->width - 1) : px);
+ py = (py >= pScreen->height ? (pScreen->height - 1) : py);
+
+ /* Setting the viewpoint makes only sense on one device */
+ if (!view_adjusted && IsMaster(dev)) {
+ xf86SetViewport(pScreen, px, py);
+ view_adjusted = TRUE;
+ }
+
+ (*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE);
+ }
}
return TRUE;