summaryrefslogtreecommitdiff
path: root/xserver/Xi
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2014-05-02 19:27:52 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2014-05-02 19:27:52 +0000
commitb9676a49e5a29d619bcd8402e4541d7749197922 (patch)
tree67cdb12cda42de5facadc0a36125a32354b3bc29 /xserver/Xi
parentfbf6414f58c54aab6ef37e4d066bb2699f118269 (diff)
Update to xserver 1.15.1.
Tested by at least ajacoutot@, dcoppa@ & jasper@
Diffstat (limited to 'xserver/Xi')
-rw-r--r--xserver/Xi/Makefile.in11
-rw-r--r--xserver/Xi/chgdctl.c6
-rw-r--r--xserver/Xi/exevents.c59
-rw-r--r--xserver/Xi/extinit.c2
-rw-r--r--xserver/Xi/grabdev.c5
-rw-r--r--xserver/Xi/setdval.c3
-rw-r--r--xserver/Xi/setmode.c4
-rw-r--r--xserver/Xi/xibarriers.c12
-rw-r--r--xserver/Xi/xibarriers.h4
-rw-r--r--xserver/Xi/xichangehierarchy.c4
-rw-r--r--xserver/Xi/xipassivegrab.c6
11 files changed, 88 insertions, 28 deletions
diff --git a/xserver/Xi/Makefile.in b/xserver/Xi/Makefile.in
index 55047df3b..fa329b042 100644
--- a/xserver/Xi/Makefile.in
+++ b/xserver/Xi/Makefile.in
@@ -189,9 +189,12 @@ DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
+DOT = @DOT@
DOXYGEN = @DOXYGEN@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRI3PROTO_CFLAGS = @DRI3PROTO_CFLAGS@
+DRI3PROTO_LIBS = @DRI3PROTO_LIBS@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
@@ -223,6 +226,7 @@ GL_LIBS = @GL_LIBS@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_LIBS@
+HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
@@ -252,6 +256,8 @@ LIBS = @LIBS@
LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@
LIBSHA1_LIBS = @LIBSHA1_LIBS@
LIBTOOL = @LIBTOOL@
+LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@
+LIBUNWIND_LIBS = @LIBUNWIND_LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@
@@ -295,6 +301,7 @@ PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PROJECTROOT = @PROJECTROOT@
+PYTHON3 = @PYTHON3@
RANLIB = @RANLIB@
RAWCPP = @RAWCPP@
RAWCPPFLAGS = @RAWCPPFLAGS@
@@ -308,12 +315,12 @@ SET_MAKE = @SET_MAKE@
SHA1_CFLAGS = @SHA1_CFLAGS@
SHA1_LIBS = @SHA1_LIBS@
SHELL = @SHELL@
-SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@
SYSCONFDIR = @SYSCONFDIR@
+TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
UDEV_CFLAGS = @UDEV_CFLAGS@
@@ -379,6 +386,8 @@ XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
XSERVER_LIBS = @XSERVER_LIBS@
XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
+XSHMFENCE_CFLAGS = @XSHMFENCE_CFLAGS@
+XSHMFENCE_LIBS = @XSHMFENCE_LIBS@
XSLTPROC = @XSLTPROC@
XSL_STYLESHEET = @XSL_STYLESHEET@
XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
diff --git a/xserver/Xi/chgdctl.c b/xserver/Xi/chgdctl.c
index 31d3a57f3..d078aa248 100644
--- a/xserver/Xi/chgdctl.c
+++ b/xserver/Xi/chgdctl.c
@@ -122,6 +122,12 @@ ProcXChangeDeviceControl(ClientPtr client)
if (ret != Success)
goto out;
+ /* XTest devices are special, none of the below apply to them anyway */
+ if (IsXTestDevice(dev, NULL)) {
+ ret = BadMatch;
+ goto out;
+ }
+
rep = (xChangeDeviceControlReply) {
.repType = X_Reply,
.RepType = X_ChangeDeviceControl,
diff --git a/xserver/Xi/exevents.c b/xserver/Xi/exevents.c
index 067e6b3e5..ad0265093 100644
--- a/xserver/Xi/exevents.c
+++ b/xserver/Xi/exevents.c
@@ -1413,7 +1413,8 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
!(ev->device_event.flags & TOUCH_CLIENT_ID))
TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
- if (deliveries && ev->any.type == ET_TouchEnd &&
+ if (ev->any.type == ET_TouchEnd &&
+ ti->num_listeners == 1 &&
!dev->button->buttonsDown &&
dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) {
(*dev->deviceGrab.DeactivateGrab) (dev);
@@ -1476,7 +1477,7 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
GrabPtr grab;
XI2Mask *mask;
- if (ti->listeners[0].type != LISTENER_POINTER_REGULAR ||
+ if (ti->listeners[0].type != LISTENER_POINTER_REGULAR &&
ti->listeners[0].type != LISTENER_POINTER_GRAB)
return;
@@ -1782,8 +1783,25 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event,
NullGrab, NullWindow, device);
- if (deactivateDeviceGrab == TRUE)
+ if (deactivateDeviceGrab == TRUE) {
(*device->deviceGrab.DeactivateGrab) (device);
+
+ if (!IsMaster (device) && !IsFloating (device)) {
+ int flags, num_events = 0;
+ InternalEvent dce;
+
+ flags = (IsPointerDevice (device)) ?
+ DEVCHANGE_POINTER_EVENT : DEVCHANGE_KEYBOARD_EVENT;
+ UpdateFromMaster (&dce, device, flags, &num_events);
+ BUG_WARN(num_events > 1);
+
+ if (num_events == 1)
+ ChangeMasterDeviceClasses(GetMaster (device, MASTER_ATTACHED),
+ &dce.changed_event);
+ }
+
+ }
+
event->detail.key = key;
}
@@ -1845,7 +1863,8 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
if (rc == Success) {
listener->state = LISTENER_IS_OWNER;
/* async grabs cannot replay, so automatically accept this touch */
- if (dev->deviceGrab.grab &&
+ if (listener->type == LISTENER_POINTER_GRAB &&
+ dev->deviceGrab.grab &&
dev->deviceGrab.fromPassiveGrab &&
dev->deviceGrab.grab->pointerMode == GrabModeAsync)
ActivateEarlyAccept(dev, ti);
@@ -1914,7 +1933,9 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
}
/* Event in response to reject */
- if (ev->device_event.flags & TOUCH_REJECT) {
+ if (ev->device_event.flags & TOUCH_REJECT ||
+ (ev->device_event.flags & TOUCH_ACCEPT && !TouchResourceIsOwner(ti, listener->listener))) {
+ /* Touch has been rejected, or accepted by its owner which is not this listener */
if (listener->state != LISTENER_HAS_END)
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
listener->state = LISTENER_HAS_END;
@@ -1937,12 +1958,6 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
if (normal_end)
listener->state = LISTENER_HAS_END;
}
- else if (ev->device_event.flags & TOUCH_ACCEPT) {
- /* Touch has been accepted by its owner, which is not this listener */
- if (listener->state != LISTENER_HAS_END)
- rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
- listener->state = LISTENER_HAS_END;
- }
out:
return rc;
@@ -2034,6 +2049,9 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev)
{
ProximityClassPtr proxc;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->proximity != NULL, FALSE);
+
proxc = (ProximityClassPtr) malloc(sizeof(ProximityClassRec));
if (!proxc)
return FALSE;
@@ -2059,10 +2077,10 @@ InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval,
{
AxisInfoPtr ax;
- if (!dev || !dev->valuator || (minval > maxval && mode == Absolute))
- return FALSE;
- if (axnum >= dev->valuator->numAxes)
- return FALSE;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->valuator == NULL, FALSE);
+ BUG_RETURN_VAL(axnum >= dev->valuator->numAxes, FALSE);
+ BUG_RETURN_VAL(minval > maxval && mode == Absolute, FALSE);
ax = dev->valuator->axes + axnum;
@@ -2092,8 +2110,9 @@ SetScrollValuator(DeviceIntPtr dev, int axnum, enum ScrollType type,
InternalEvent dce;
DeviceIntPtr master;
- if (!dev || !dev->valuator || axnum >= dev->valuator->numAxes)
- return FALSE;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->valuator == NULL, FALSE);
+ BUG_RETURN_VAL(axnum >= dev->valuator->numAxes, FALSE);
switch (type) {
case SCROLL_TYPE_VERTICAL:
@@ -2164,7 +2183,8 @@ CheckGrabValues(ClientPtr client, GrabParameters *param)
return BadValue;
}
- if (param->grabtype != XI2 && (param->modifiers != AnyModifier) &&
+ if (param->modifiers != AnyModifier &&
+ param->modifiers != XIAnyModifier &&
(param->modifiers & ~AllModifiersMask)) {
client->errorValue = param->modifiers;
return BadValue;
@@ -2233,8 +2253,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
}
/**
- * Grab the given key. If grabtype is XI, the key is a keycode. If
- * grabtype is XI2, the key is a keysym.
+ * Grab the given key.
*/
int
GrabKey(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
diff --git a/xserver/Xi/extinit.c b/xserver/Xi/extinit.c
index 02fffe574..a49a42152 100644
--- a/xserver/Xi/extinit.c
+++ b/xserver/Xi/extinit.c
@@ -1171,6 +1171,8 @@ IResetProc(ExtensionEntry * unused)
free(xi_all_devices.name);
free(xi_all_master_devices.name);
+
+ XIBarrierReset();
}
/***********************************************************************
diff --git a/xserver/Xi/grabdev.c b/xserver/Xi/grabdev.c
index 443ef56c1..9c6c429ed 100644
--- a/xserver/Xi/grabdev.c
+++ b/xserver/Xi/grabdev.c
@@ -175,10 +175,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
int device;
DeviceIntPtr tdev;
- for (i = 0; i < EMASKSIZE; i++) {
- mask[i].mask = 0;
- mask[i].dev = NULL;
- }
+ memset(mask, 0, EMASKSIZE * sizeof(struct tmask));
for (i = 0; i < count; i++, list++) {
device = *list >> 8;
diff --git a/xserver/Xi/setdval.c b/xserver/Xi/setdval.c
index 4c9c99f55..463e4f38c 100644
--- a/xserver/Xi/setdval.c
+++ b/xserver/Xi/setdval.c
@@ -110,6 +110,9 @@ ProcXSetDeviceValuators(ClientPtr client)
if (dev->valuator == NULL)
return BadMatch;
+ if (IsXTestDevice(dev, NULL))
+ return BadMatch;
+
if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes)
return BadValue;
diff --git a/xserver/Xi/setmode.c b/xserver/Xi/setmode.c
index 535655257..5ed09136e 100644
--- a/xserver/Xi/setmode.c
+++ b/xserver/Xi/setmode.c
@@ -104,6 +104,10 @@ ProcXSetDeviceMode(ClientPtr client)
return rc;
if (dev->valuator == NULL)
return BadMatch;
+
+ if (IsXTestDevice(dev, NULL))
+ return BadMatch;
+
if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client))
rep.status = AlreadyGrabbed;
else
diff --git a/xserver/Xi/xibarriers.c b/xserver/Xi/xibarriers.c
index fccab8615..6732ce9dc 100644
--- a/xserver/Xi/xibarriers.c
+++ b/xserver/Xi/xibarriers.c
@@ -917,3 +917,15 @@ XIBarrierInit(void)
return PointerBarrierType;
}
+
+void
+XIBarrierReset(void)
+{
+ int i;
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ BarrierScreenPtr cs = GetBarrierScreen(pScreen);
+ free(cs);
+ SetBarrierScreen(pScreen, NULL);
+ }
+}
diff --git a/xserver/Xi/xibarriers.h b/xserver/Xi/xibarriers.h
index 11e84ec9f..f61b48214 100644
--- a/xserver/Xi/xibarriers.h
+++ b/xserver/Xi/xibarriers.h
@@ -36,8 +36,8 @@ int
XIDestroyPointerBarrier(ClientPtr client,
xXFixesDestroyPointerBarrierReq * stuff);
-Bool
-XIBarrierInit(void);
+Bool XIBarrierInit(void);
+void XIBarrierReset(void);
int SProcXIBarrierReleasePointer(ClientPtr client);
int ProcXIBarrierReleasePointer(ClientPtr client);
diff --git a/xserver/Xi/xichangehierarchy.c b/xserver/Xi/xichangehierarchy.c
index e2f4b8a0a..9e36354d1 100644
--- a/xserver/Xi/xichangehierarchy.c
+++ b/xserver/Xi/xichangehierarchy.c
@@ -143,6 +143,10 @@ add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES])
int rc;
name = calloc(c->name_len + 1, sizeof(char));
+ if (name == NULL) {
+ rc = BadAlloc;
+ goto unwind;
+ }
strncpy(name, (char *) &c[1], c->name_len);
rc = AllocDevicePair(client, name, &ptr, &keybd,
diff --git a/xserver/Xi/xipassivegrab.c b/xserver/Xi/xipassivegrab.c
index eccec0ab8..700622d38 100644
--- a/xserver/Xi/xipassivegrab.c
+++ b/xserver/Xi/xipassivegrab.c
@@ -63,7 +63,7 @@ SProcXIPassiveGrabDevice(ClientPtr client)
swaps(&stuff->mask_len);
swaps(&stuff->num_modifiers);
- mods = (uint32_t *) &stuff[1];
+ mods = (uint32_t *) &stuff[1] + stuff->mask_len;
for (i = 0; i < stuff->num_modifiers; i++, mods++) {
swapl(mods);
@@ -189,6 +189,10 @@ ProcXIPassiveGrabDevice(ClientPtr client)
uint8_t status = Success;
param.modifiers = *modifiers;
+ ret = CheckGrabValues(client, &param);
+ if (ret != Success)
+ goto out;
+
switch (stuff->grab_type) {
case XIGrabtypeButton:
status = GrabButton(client, dev, mod_dev, stuff->detail,