summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Thayer <michael.thayer@oracle.com>2014-04-24 10:32:17 +0200
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-20 21:11:22 -0700
commite83991474e9964917ea6ece5ad21d1bf56481dfa (patch)
tree4fe6cf994af9a4ef804dc6a95fd2e6d2a11dbb08
parent7a1fb986cc5ace474b6f040179bd130d4ba6f78f (diff)
Make absolute input reporting in Solaris aware of resolution changes
Currently on Solaris absolute input reporting only takes resolution changes into account when the video driver is using the pre-RandR 1.2 APIs, and there it uses the physical resolution, not the virtual. This patch fixes those two things. Signed-off-by: Michael Thayer <michael.thayer@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/sun_mouse.c42
1 files changed, 33 insertions, 9 deletions
diff --git a/src/sun_mouse.c b/src/sun_mouse.c
index 16434e6..b092374 100644
--- a/src/sun_mouse.c
+++ b/src/sun_mouse.c
@@ -57,6 +57,7 @@
#include "mouse.h"
#include "xisb.h"
#include "mipointer.h"
+#include "xf86Crtc.h"
#include <sys/stropts.h>
#include <sys/vuid_event.h>
#include <sys/msio.h>
@@ -405,14 +406,11 @@ static void vuidMouseSendScreenSize(ScreenPtr pScreen, VuidMsePtr pVuidMse)
ScrnInfoPtr pScr = XF86SCRNINFO(pScreen);
int result;
- if (!pScr->currentMode)
- return;
-
- if ((pVuidMse->absres.width != pScr->currentMode->HDisplay) ||
- (pVuidMse->absres.height != pScr->currentMode->VDisplay))
+ if ((pVuidMse->absres.width != pScr->virtualX) ||
+ (pVuidMse->absres.height != pScr->virtualY))
{
- pVuidMse->absres.width = pScr->currentMode->HDisplay;
- pVuidMse->absres.height = pScr->currentMode->VDisplay;
+ pVuidMse->absres.width = pScr->virtualX;
+ pVuidMse->absres.height = pScr->virtualY;
do {
result = ioctl(pInfo->fd, MSIOSRESOLUTION, &(pVuidMse->absres));
@@ -457,6 +455,24 @@ static void vuidMouseAdjustFrame(ADJUST_FRAME_ARGS_DECL)
}
}
}
+
+static void vuidMouseCrtcNotify(ScreenPtr pScreen)
+{
+ xf86_crtc_notify_proc_ptr wrappedCrtcNotify
+ = (xf86_crtc_notify_proc_ptr) vuidMouseGetScreenPrivate(pScreen);
+ VuidMsePtr m;
+ ScreenPtr ptrCurScreen;
+
+ if (wrappedCrtcNotify)
+ wrappedCrtcNotify(pScreen);
+
+ for (m = vuidMouseList; m != NULL ; m = m->next) {
+ ptrCurScreen = miPointerGetScreen(m->pInfo->dev);
+ if (ptrCurScreen == pScreen) {
+ vuidMouseSendScreenSize(pScreen, m);
+ }
+ }
+}
#endif /* HAVE_ABSOLUTE_MOUSE_SCALING */
@@ -492,8 +508,16 @@ vuidMouseProc(DeviceIntPtr pPointer, int what)
for (i = 0; i < screenInfo.numScreens; i++) {
ScreenPtr pScreen = screenInfo.screens[i];
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
- vuidMouseSetScreenPrivate(pScreen, pScrn->AdjustFrame);
- pScrn->AdjustFrame = vuidMouseAdjustFrame;
+ if (xf86CrtcConfigPrivateIndex != -1) {
+ xf86_crtc_notify_proc_ptr pCrtcNotify
+ = xf86_wrap_crtc_notify(pScreen,
+ vuidMouseCrtcNotify);
+ vuidMouseSetScreenPrivate(pScreen, pCrtcNotify);
+ } else {
+ vuidMouseSetScreenPrivate(pScreen,
+ pScrn->AdjustFrame);
+ pScrn->AdjustFrame = vuidMouseAdjustFrame;
+ }
}
vuidMouseGeneration = serverGeneration;
}