[sawfish] Tolerate CurrentTime in selection requests.
- From: Christopher Bratusek <chrisb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sawfish] Tolerate CurrentTime in selection requests.
- Date: Mon, 27 Dec 2010 20:38:51 +0000 (UTC)
commit 8f1f2f2d6e3c4c132613450a3986309381e5e943
Author: Timo Korvola <tkorvola iki fi>
Date: Mon Dec 27 16:55:22 2010 +0200
Tolerate CurrentTime in selection requests.
According to the ICCCM clients should not use CurrentTime. However,
at least Tk (wish) sometimes does, so it needs to be tolerated.
Also somewhat improved debugging output.
src/display.c | 1 -
src/events.c | 9 +++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/display.c b/src/display.c
index 1181bbf..0110a95 100644
--- a/src/display.c
+++ b/src/display.c
@@ -334,7 +334,6 @@ acquire_manager_selection(Window sel_owner)
if (ev.type == DestroyNotify
&& ev.xdestroywindow.window == sel_owner)
break;
- fputs ("Wrong event! Still waiting.\n", stderr);
}
}
cm.message_type = xa_manager;
diff --git a/src/events.c b/src/events.c
index 9ceaaeb..915b42e 100644
--- a/src/events.c
+++ b/src/events.c
@@ -1366,8 +1366,8 @@ selection_request (XEvent *ev)
/* Refuse by default. */
reply.property = None;
reply.time = req->time;
- if (req->selection == xa_wm_sn
- && req->owner == no_focus_window && req->time >= startup_time)
+ if (req->selection == xa_wm_sn && req->owner == no_focus_window
+ && (req->time == CurrentTime || req->time >= startup_time))
{
Atom prop = req->property;
if (prop == None && req->target != xa_multiple)
@@ -1375,6 +1375,11 @@ selection_request (XEvent *ev)
if (convert_selection(req->requestor, req->target, prop))
reply.property = prop;
}
+ else
+ fprintf(stderr, "Selection request for %s, %s.\n",
+ XGetAtomName(dpy, req->selection),
+ req->time == CurrentTime ? "CurrentTime"
+ : req->time < startup_time ? "early" : "normal time");
XSendEvent(dpy, req->requestor, False, 0, (XEvent *) &reply);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]