summaryrefslogtreecommitdiff
path: root/xserver/Xi
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2013-08-24 19:44:53 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2013-08-24 19:44:53 +0000
commitdf24d8ef31d08c702cd0d7836ef963d7f8860d64 (patch)
treeba5e32b23c40192e85bacee63da561977a1b5e77 /xserver/Xi
parent8aac304d65480d9e64293babdcf7cfa3c30188fd (diff)
Uodate to xserver 1.14.2. Tested by krw@, shadchin@, todd@
Diffstat (limited to 'xserver/Xi')
-rw-r--r--xserver/Xi/Makefile.in2
-rw-r--r--xserver/Xi/devbell.c3
-rw-r--r--xserver/Xi/exevents.c42
-rw-r--r--xserver/Xi/extinit.c36
-rw-r--r--xserver/Xi/xigrabdev.c15
5 files changed, 57 insertions, 41 deletions
diff --git a/xserver/Xi/Makefile.in b/xserver/Xi/Makefile.in
index f24ac40c8..55047df3b 100644
--- a/xserver/Xi/Makefile.in
+++ b/xserver/Xi/Makefile.in
@@ -292,6 +292,8 @@ PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
PIXMAN_LIBS = @PIXMAN_LIBS@
PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PROJECTROOT = @PROJECTROOT@
RANLIB = @RANLIB@
RAWCPP = @RAWCPP@
diff --git a/xserver/Xi/devbell.c b/xserver/Xi/devbell.c
index c75b94dee..202c8de18 100644
--- a/xserver/Xi/devbell.c
+++ b/xserver/Xi/devbell.c
@@ -142,7 +142,8 @@ ProcXDeviceBell(ClientPtr client)
newpercent = base + newpercent;
else
newpercent = base - newpercent + stuff->percent;
+ if (proc == NULL)
+ return BadValue;
(*proc) (newpercent, dev, ctrl, class);
-
return Success;
}
diff --git a/xserver/Xi/exevents.c b/xserver/Xi/exevents.c
index f05e03d73..d39cf89a7 100644
--- a/xserver/Xi/exevents.c
+++ b/xserver/Xi/exevents.c
@@ -1221,9 +1221,16 @@ TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource,
* touchpoint if it is pending finish.
*/
static void
-ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
- TouchOwnershipEvent *ev)
+ProcessTouchOwnershipEvent(TouchOwnershipEvent *ev,
+ DeviceIntPtr dev)
{
+ TouchPointInfoPtr ti = TouchFindByClientID(dev, ev->touchid);
+
+ if (!ti) {
+ DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n",
+ dev->name, ev->type, ev->touchid);
+ return;
+ }
if (ev->reason == XIRejectTouch)
TouchRejected(dev, ti, ev->resource, ev);
@@ -1536,10 +1543,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
if (!t)
return;
- if (ev->any.type == ET_TouchOwnership)
- touchid = ev->touch_ownership_event.touchid;
- else
- touchid = ev->device_event.touchid;
+ touchid = ev->device_event.touchid;
if (type == ET_TouchBegin) {
ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
@@ -1612,19 +1616,13 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
(type != ET_TouchEnd && ti->sprite.spriteTraceGood == 0))
return;
- /* TouchOwnership events are handled separately from the rest, as they
- * have more complex semantics. */
- if (ev->any.type == ET_TouchOwnership)
- ProcessTouchOwnershipEvent(dev, ti, &ev->touch_ownership_event);
- else {
- TouchCopyValuatorData(&ev->device_event, ti);
- /* WARNING: the event type may change to TouchUpdate in
- * DeliverTouchEvents if a TouchEnd was delivered to a grabbing
- * owner */
- DeliverTouchEvents(dev, ti, (InternalEvent *) ev, 0);
- if (ev->any.type == ET_TouchEnd)
- TouchEndTouch(dev, ti);
- }
+ TouchCopyValuatorData(&ev->device_event, ti);
+ /* WARNING: the event type may change to TouchUpdate in
+ * DeliverTouchEvents if a TouchEnd was delivered to a grabbing
+ * owner */
+ DeliverTouchEvents(dev, ti, (InternalEvent *) ev, 0);
+ if (ev->any.type == ET_TouchEnd)
+ TouchEndTouch(dev, ti);
if (emulate_pointer)
UpdateDeviceState(dev, &ev->device_event);
@@ -1818,10 +1816,14 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
break;
case ET_TouchBegin:
case ET_TouchUpdate:
- case ET_TouchOwnership:
case ET_TouchEnd:
ProcessTouchEvent(ev, device);
break;
+ case ET_TouchOwnership:
+ /* TouchOwnership events are handled separately from the rest, as they
+ * have more complex semantics. */
+ ProcessTouchOwnershipEvent(&ev->touch_ownership_event, device);
+ break;
case ET_BarrierHit:
case ET_BarrierLeave:
ProcessBarrierEvent(ev, device);
diff --git a/xserver/Xi/extinit.c b/xserver/Xi/extinit.c
index 619d0e468..02fffe574 100644
--- a/xserver/Xi/extinit.c
+++ b/xserver/Xi/extinit.c
@@ -848,24 +848,24 @@ SBarrierEvent(xXIBarrierEvent * from,
*to = *from;
- swaps(&from->sequenceNumber);
- swapl(&from->length);
- swaps(&from->evtype);
- swapl(&from->time);
- swaps(&from->deviceid);
- swaps(&from->sourceid);
- swapl(&from->event);
- swapl(&from->root);
- swapl(&from->root_x);
- swapl(&from->root_y);
-
- swapl(&from->dx.integral);
- swapl(&from->dx.frac);
- swapl(&from->dy.integral);
- swapl(&from->dy.frac);
- swapl(&from->dtime);
- swapl(&from->barrier);
- swapl(&from->eventid);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swapl(&to->time);
+ swaps(&to->deviceid);
+ swaps(&to->sourceid);
+ swapl(&to->event);
+ swapl(&to->root);
+ swapl(&to->root_x);
+ swapl(&to->root_y);
+
+ swapl(&to->dx.integral);
+ swapl(&to->dx.frac);
+ swapl(&to->dy.integral);
+ swapl(&to->dy.frac);
+ swapl(&to->dtime);
+ swapl(&to->barrier);
+ swapl(&to->eventid);
}
/** Event swapping function for XI2 events. */
diff --git a/xserver/Xi/xigrabdev.c b/xserver/Xi/xigrabdev.c
index 09186e84f..63d95bc1c 100644
--- a/xserver/Xi/xigrabdev.c
+++ b/xserver/Xi/xigrabdev.c
@@ -67,6 +67,8 @@ ProcXIGrabDevice(ClientPtr client)
uint8_t status;
GrabMask mask = { 0 };
int mask_len;
+ unsigned int keyboard_mode;
+ unsigned int pointer_mode;
REQUEST(xXIGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
@@ -78,6 +80,15 @@ ProcXIGrabDevice(ClientPtr client)
if (!IsMaster(dev))
stuff->paired_device_mode = GrabModeAsync;
+ if (IsKeyboardDevice(dev)) {
+ keyboard_mode = stuff->grab_mode;
+ pointer_mode = stuff->paired_device_mode;
+ }
+ else {
+ keyboard_mode = stuff->paired_device_mode;
+ pointer_mode = stuff->grab_mode;
+ }
+
if (XICheckInvalidMaskBits(client, (unsigned char *) &stuff[1],
stuff->mask_len * 4) != Success)
return BadValue;
@@ -91,8 +102,8 @@ ProcXIGrabDevice(ClientPtr client)
xi2mask_set_one_mask(mask.xi2mask, dev->id, (unsigned char *) &stuff[1],
mask_len);
- ret = GrabDevice(client, dev, stuff->grab_mode,
- stuff->paired_device_mode,
+ ret = GrabDevice(client, dev, pointer_mode,
+ keyboard_mode,
stuff->grab_window,
stuff->owner_events,
stuff->time,