[PATCH 1/2] mi: fix cursor warping screens
Vignatti Tiago (Nokia-D/Helsinki)
tiago.vignatti at nokia.com
Wed Aug 5 11:26:15 PDT 2009
Ooops, I messed the script. Well, the email is mine :)
On Wed, Aug 05, 2009 at 08:18:55PM +0200, y at mail.nokia.com wrote:
> From: Tiago Vignatti <tiago.vignatti at nokia.com>
>
> 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.
>
> Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
> ---
> mi/mieq.c | 24 ++++++++++++++++--------
> 1 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/mi/mieq.c b/mi/mieq.c
> index 6ec2dba..b52ed84 100644
> --- a/mi/mieq.c
> +++ b/mi/mieq.c
> @@ -367,14 +367,22 @@ 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);
> - }
> - else {
> + 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:
> master = CopyGetMasterEvent(dev, event, &mevent);
>
> if (master)
> --
> 1.5.6.3
Tiago
More information about the xorg-devel
mailing list