aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/Xi/exevents.c35
-rw-r--r--xorg-server/dix/events.c11
-rw-r--r--xorg-server/os/log.c3
-rw-r--r--xorg-server/xkb/xkbInit.c6
4 files changed, 39 insertions, 16 deletions
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index 2bbc6f091..fd4b80c48 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -1223,9 +1223,13 @@ ProcessTouchOwnershipEvent(TouchOwnershipEvent *ev,
else if (ev->reason == XIAcceptTouch) {
int i;
- /* Go through the motions of ending the touch if the listener has
+
+ /* For pointer-emulated listeners that ungrabbed the active grab,
+ * the state was forced to LISTENER_HAS_END. Still go
+ * through the motions of ending the touch if the listener has
* already seen the end. This ensures that the touch record is ended in
- * the server. */
+ * the server.
+ */
if (ti->listeners[0].state == LISTENER_HAS_END)
TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[0].listener);
@@ -1883,16 +1887,23 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
if (listener->type == LISTENER_POINTER_REGULAR ||
listener->type == LISTENER_POINTER_GRAB) {
- rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
- grab, xi2mask);
-
- /* Once we send a TouchEnd to a legacy listener, we're already well
- * past the accepting/rejecting stage (can only happen on
- * GrabModeSync + replay. This listener now gets the end event,
- * and we can continue.
- */
- if (rc == Success)
- listener->state = LISTENER_HAS_END;
+ /* Note: If the active grab was ungrabbed, we already changed the
+ * state to LISTENER_HAS_END but still get here. So we mustn't
+ * actually send the event.
+ * This is part two of the hack in DeactivatePointerGrab
+ */
+ if (listener->state != LISTENER_HAS_END) {
+ rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
+ grab, xi2mask);
+
+ /* Once we send a TouchEnd to a legacy listener, we're already well
+ * past the accepting/rejecting stage (can only happen on
+ * GrabModeSync + replay. This listener now gets the end event,
+ * and we can continue.
+ */
+ if (rc == Success)
+ listener->state = LISTENER_HAS_END;
+ }
goto out;
}
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index e5db348c6..03b2d2ea7 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -1522,13 +1522,20 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
for (i = 0; !wasPassive && mouse->touch && i < mouse->touch->num_touches; i++) {
TouchPointInfoPtr ti = mouse->touch->touches + i;
if (ti->active && TouchResourceIsOwner(ti, grab_resource)) {
+ int mode = XIRejectTouch;
/* Rejecting will generate a TouchEnd, but we must not
emulate a ButtonRelease here. So pretend the listener
already has the end event */
if (grab->grabtype == CORE || grab->grabtype == XI ||
- !xi2mask_isset(mouse->deviceGrab.grab->xi2mask, mouse, XI_TouchBegin))
+ !xi2mask_isset(mouse->deviceGrab.grab->xi2mask, mouse, XI_TouchBegin)) {
+ mode = XIAcceptTouch;
+ /* NOTE: we set the state here, but
+ * ProcessTouchOwnershipEvent() will still call
+ * TouchEmitTouchEnd for this listener. The other half of
+ * this hack is in DeliverTouchEndEvent */
ti->listeners[0].state = LISTENER_HAS_END;
- TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch);
+ }
+ TouchListenerAcceptReject(mouse, ti, 0, mode);
}
}
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c
index f19faf5ee..53b358629 100644
--- a/xorg-server/os/log.c
+++ b/xorg-server/os/log.c
@@ -216,6 +216,9 @@ LogInit(const char *fname, const char *backup)
free(oldLog);
}
}
+ else {
+ unlink(logFileName);
+ }
if ((logFile = fopen(logFileName, "w")) == NULL)
FatalError("Cannot open log file \"%s\"\n", logFileName);
setvbuf(logFile, NULL, _IONBF, 0);
diff --git a/xorg-server/xkb/xkbInit.c b/xorg-server/xkb/xkbInit.c
index 5308a29df..f72655fc3 100644
--- a/xorg-server/xkb/xkbInit.c
+++ b/xorg-server/xkb/xkbInit.c
@@ -759,13 +759,15 @@ XkbProcessArguments(int argc, char *argv[], int i)
if ((strcmp(argv[i], "-ardelay") == 0) || (strcmp(argv[i], "-ar1") == 0)) { /* -ardelay int */
if (++i >= argc)
UseMsg();
- XkbDfltRepeatDelay = (long) atoi(argv[i]);
+ else
+ XkbDfltRepeatDelay = (long) atoi(argv[i]);
return 2;
}
if ((strcmp(argv[i], "-arinterval") == 0) || (strcmp(argv[i], "-ar2") == 0)) { /* -arinterval int */
if (++i >= argc)
UseMsg();
- XkbDfltRepeatInterval = (long) atoi(argv[i]);
+ else
+ XkbDfltRepeatInterval = (long) atoi(argv[i]);
return 2;
}
return 0;