From e22891346b85a7db40dec7260a100f90b451cbc8 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 23 Dec 2011 10:01:52 +0100 Subject: git mesa pixman xserver xkeyboard-config update 24 dec 2011 --- xorg-server/mi/mieq.c | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) (limited to 'xorg-server/mi/mieq.c') diff --git a/xorg-server/mi/mieq.c b/xorg-server/mi/mieq.c index 093dba20f..6c46eb9fe 100644 --- a/xorg-server/mi/mieq.c +++ b/xorg-server/mi/mieq.c @@ -370,8 +370,14 @@ ChangeDeviceID(DeviceIntPtr dev, InternalEvent* event) case ET_ProximityOut: case ET_Hierarchy: case ET_DeviceChanged: + case ET_TouchBegin: + case ET_TouchUpdate: + case ET_TouchEnd: event->device_event.deviceid = dev->id; break; + case ET_TouchOwnership: + event->touch_ownership_event.deviceid = dev->id; + break; #if XFreeXDGA case ET_DGAEvent: break; @@ -381,6 +387,9 @@ ChangeDeviceID(DeviceIntPtr dev, InternalEvent* event) case ET_RawButtonPress: case ET_RawButtonRelease: case ET_RawMotion: + case ET_RawTouchBegin: + case ET_RawTouchEnd: + case ET_RawTouchUpdate: event->raw_event.deviceid = dev->id; break; default: @@ -462,6 +471,19 @@ CopyGetMasterEvent(DeviceIntPtr sdev, } +static void +mieqMoveToNewScreen(DeviceIntPtr dev, ScreenPtr screen, DeviceEvent *event) +{ + if (dev && screen && screen != DequeueScreen(dev)) + { + int x = 0, y = 0; + DequeueScreen(dev) = screen; + x = event->root_x; + y = event->root_y; + NewCurrentScreen (dev, DequeueScreen(dev), x, y); + } +} + /** * Post the given @event through the device hierarchy, as appropriate. * Use this function if an event must be posted for a given device during the @@ -473,7 +495,6 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, ScreenPtr screen) { mieqHandler handler; - int x = 0, y = 0; DeviceIntPtr master; InternalEvent mevent; /* master event */ @@ -490,12 +511,14 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, case ET_KeyRelease: case ET_ButtonPress: case ET_ButtonRelease: - if (dev && screen && screen != DequeueScreen(dev) && !handler) { - DequeueScreen(dev) = screen; - x = event->device_event.root_x; - y = event->device_event.root_y; - NewCurrentScreen (dev, DequeueScreen(dev), x, y); - } + if (!handler) + mieqMoveToNewScreen(dev, screen, &event->device_event); + break; + case ET_TouchBegin: + case ET_TouchUpdate: + case ET_TouchEnd: + if (!handler && (event->device_event.flags & TOUCH_POINTER_EMULATED)) + mieqMoveToNewScreen(dev, screen, &event->device_event); break; default: break; -- cgit v1.2.3