[PATCH weston 3/3] compositor-x11: verify that detectable repeat was really set
Ran Benita
ran234 at gmail.com
Wed Oct 31 11:14:58 PDT 2012
Since the XKB says that support for detectable repeat is in fact
optional:
http://www.x.org/releases/current/doc/kbproto/xkbproto.html#Querying_and_Changing_Per_Client_Flags
we might as well be good citizens and check that it was really set. With
the X server this would never happen, though.
Signed-off-by: Ran Benita <ran234 at gmail.com>
---
src/compositor-x11.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index 001dec4..c575f25 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -249,9 +249,11 @@ x11_compositor_setup_xkb(struct x11_compositor *c)
0,
0);
pcf_reply = xcb_xkb_per_client_flags_reply(c->conn, pcf, NULL);
- if (!pcf_reply) {
+ if (!pcf_reply ||
+ !(pcf_reply->value & XCB_XKB_PER_CLIENT_FLAG_DETECTABLE_AUTO_REPEAT)) {
weston_log("failed to set XKB per-client flags, not using "
"detectable repeat\n");
+ free(pcf_reply);
return;
}
free(pcf_reply);
--
1.8.0
More information about the wayland-devel
mailing list