summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2009-08-05 21:02:29 +0300
committerTiago Vignatti <tiago.vignatti@nokia.com>2009-08-08 20:09:32 +0300
commitf9a2fff2248d7254958857677cabfea914ed4853 (patch)
tree1a59895222c7efb6881ebd58a8f1f413969f8982 /mi
parentd573cc46d3106824902ab4f926617bd9959af57c (diff)
mi: fix cursor warping screens
The server was processing ET_RawMotion type when the cursor was wrapping to another screen and getting wrong valuator values. This fix such issue considering only ET_Motion, ET_KeyPress, ET_KeyRelease, ET_ButtonPress and ET_ButtonRelease types when the cursor detects a new screen, keeping the "normal" processing of device events. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'mi')
-rw-r--r--mi/mieq.c67
1 files changed, 38 insertions, 29 deletions
diff --git a/mi/mieq.c b/mi/mieq.c
index 6ec2dba08..b27e9da22 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -367,39 +367,48 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
/* Custom event handler */
handler = miEventQueue.handlers[event->any.type];
- if (dev && screen && screen != DequeueScreen(dev) && !handler) {
- /* Assumption - screen switching can only occur on motion events. */
- DequeueScreen(dev) = screen;
- x = event->device.root_x;
- y = event->device.root_y;
- NewCurrentScreen (dev, DequeueScreen(dev), x, y);
+ switch (event->any.type) {
+ /* Catch events that include valuator information and check if they
+ * are changing the screen */
+ case ET_Motion:
+ case ET_KeyPress:
+ case ET_KeyRelease:
+ case ET_ButtonPress:
+ case ET_ButtonRelease:
+ if (dev && screen && screen != DequeueScreen(dev) && !handler) {
+ DequeueScreen(dev) = screen;
+ x = event->device.root_x;
+ y = event->device.root_y;
+ NewCurrentScreen (dev, DequeueScreen(dev), x, y);
+ }
+ break;
+ default:
+ break;
}
- else {
- master = CopyGetMasterEvent(dev, event, &mevent);
+ master = CopyGetMasterEvent(dev, event, &mevent);
- if (master)
- master->u.lastSlave = dev;
+ if (master)
+ master->u.lastSlave = dev;
- /* If someone's registered a custom event handler, let them
- * steal it. */
- if (handler)
- {
- int screenNum = dev && DequeueScreen(dev) ? DequeueScreen(dev)->myNum : (screen ? screen->myNum : 0);
- handler(screenNum, event, dev);
- /* Check for the SD's master in case the device got detached
- * during event processing */
- if (master && dev->u.master)
- handler(screenNum, &mevent, master);
- } else
- {
- /* process slave first, then master */
- dev->public.processInputProc(event, dev);
+ /* If someone's registered a custom event handler, let them
+ * steal it. */
+ if (handler)
+ {
+ int screenNum = dev && DequeueScreen(dev) ? DequeueScreen(dev)->myNum : (screen ? screen->myNum : 0);
+ handler(screenNum, event, dev);
+ /* Check for the SD's master in case the device got detached
+ * during event processing */
+ if (master && dev->u.master)
+ handler(screenNum, &mevent, master);
+ } else
+ {
+ /* process slave first, then master */
+ dev->public.processInputProc(event, dev);
- /* Check for the SD's master in case the device got detached
- * during event processing */
- if (master && dev->u.master)
- master->public.processInputProc(&mevent, master);
- }
+ /* Check for the SD's master in case the device got detached
+ * during event processing */
+ if (master && dev->u.master)
+ master->public.processInputProc(&mevent, master);
}
}