aboutsummaryrefslogtreecommitdiff
path: root/libX11/modules/im/ximcp/imDefIc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-08-19 09:07:37 +0200
committermarha <marha@users.sourceforge.net>2013-08-19 09:07:37 +0200
commit2d042f719910c5aa1ba9f4a47b21009c729c345e (patch)
tree2b20d89d5f1ca342ca6f1d817c18b324adf7086f /libX11/modules/im/ximcp/imDefIc.c
parentc3d3ea464f7f4e53e8fe3e11ecada36cb209ba4d (diff)
parent854ec4da20ddff9b830be0a7d5b81d8cb4774132 (diff)
downloadvcxsrv-2d042f719910c5aa1ba9f4a47b21009c729c345e.tar.gz
vcxsrv-2d042f719910c5aa1ba9f4a47b21009c729c345e.tar.bz2
vcxsrv-2d042f719910c5aa1ba9f4a47b21009c729c345e.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig libX11 libXdmcp libxcb xkeyboard-config mesa pixman xserver git update 19 aug 2013 Conflicts: fontconfig/src/fccache.c
Diffstat (limited to 'libX11/modules/im/ximcp/imDefIc.c')
-rw-r--r--libX11/modules/im/ximcp/imDefIc.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libX11/modules/im/ximcp/imDefIc.c b/libX11/modules/im/ximcp/imDefIc.c
index 3b5fa4147..f7e484789 100644
--- a/libX11/modules/im/ximcp/imDefIc.c
+++ b/libX11/modules/im/ximcp/imDefIc.c
@@ -927,6 +927,30 @@ _XimProtoDestroyIC(
return;
}
+/*
+ * Some functions require the request queue from the server to be flushed
+ * so that the ordering of client initiated status changes and those requested
+ * by the server is well defined.
+ * _XimSync() would be the function of choice here as it should get a
+ * XIM_SYNC_REPLY back from the server.
+ * This however isn't implemented in the piece of junk that is used by most
+ * input servers as the server side protocol if to XIM.
+ * Since this code is not shipped as a library together with the client side
+ * XIM code but is duplicated by every input server around the world there
+ * is no easy fix to this but this ugly hack below.
+ * Obtaining an IC value from the server sends a request and empties out the
+ * event/server request queue until the answer to this request is found.
+ * Thus it is guaranteed that any pending server side request gets processed.
+ * This is what the hack below is doing.
+ */
+
+static void
+BrokenSyncWithServer(XIC xic)
+{
+ CARD32 dummy;
+ XGetICValues(xic, XNFilterEvents, &dummy, NULL);
+}
+
static void
_XimProtoSetFocus(
XIC xic)
@@ -957,6 +981,7 @@ _XimProtoSetFocus(
}
}
#endif /* XIM_CONNECTABLE */
+ BrokenSyncWithServer(xic);
buf_s[0] = im->private.proto.imid; /* imid */
buf_s[1] = ic->private.proto.icid; /* icid */
@@ -1003,6 +1028,8 @@ _XimProtoUnsetFocus(
}
#endif /* XIM_CONNECTABLE */
+ BrokenSyncWithServer(xic);
+
buf_s[0] = im->private.proto.imid; /* imid */
buf_s[1] = ic->private.proto.icid; /* icid */