summaryrefslogtreecommitdiff
path: root/lib/libX11/modules/im/ximcp/imDefIm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libX11/modules/im/ximcp/imDefIm.c')
-rw-r--r--lib/libX11/modules/im/ximcp/imDefIm.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/libX11/modules/im/ximcp/imDefIm.c b/lib/libX11/modules/im/ximcp/imDefIm.c
index fe4d18ba3..e30753989 100644
--- a/lib/libX11/modules/im/ximcp/imDefIm.c
+++ b/lib/libX11/modules/im/ximcp/imDefIm.c
@@ -63,6 +63,8 @@ PERFORMANCE OF THIS SOFTWARE.
#include "Ximint.h"
#include <limits.h>
+#include <stdlib.h>
+#include <strings.h>
int
_XimCheckDataSize(
@@ -400,6 +402,7 @@ _XimPreConnect(
Atom *atoms;
Window im_window = 0;
register int i;
+ const char *env_enable_fabricated_order;
if((imserver = XInternAtom(display, XIM_SERVERS, True)) == (Atom)None)
return False;
@@ -430,6 +433,16 @@ _XimPreConnect(
return False;
im->private.proto.im_window = im_window;
+ im->private.proto.fabricated_serial = 0;
+ im->private.proto.fabricated_time = 0;
+ im->private.proto.enable_fabricated_order = True;
+ env_enable_fabricated_order = getenv("LIBX11_ENABLE_FABRICATED_ORDER");
+ if (env_enable_fabricated_order && *env_enable_fabricated_order) {
+ if (!strncasecmp(env_enable_fabricated_order, "0", 2) ||
+ !strncasecmp(env_enable_fabricated_order, "false", 6)) {
+ im->private.proto.enable_fabricated_order = False;
+ }
+ }
return True;
}
@@ -1314,8 +1327,11 @@ _XimProtoSetIMValues(
}
_XimSetCurrentIMValues(im, &im_values);
- if (!total)
- return (char *)NULL;
+ if (!total) {
+ if (buf != tmp_buf)
+ Xfree(buf);
+ return (char *)NULL;
+ }
buf_s = (CARD16 *)&buf[XIM_HEADER_SIZE];
buf_s[0] = im->private.proto.imid;