summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTakao Fujiwara <tfujiwar@redhat.com>2024-04-26 01:29:39 +0900
committerTakao Fujiwara <tfujiwar@redhat.com>2024-04-26 01:29:39 +0900
commit90b8fc65da1e773b0091a50be46b23609591e8b7 (patch)
tree7628b3ce8ac0e526d41f8576271d557b9a62238d /modules
parent898746f9b1fb384d6d24ed827c836ec8a0b3da3b (diff)
imDefIm: Add LIBX11_ENABLE_FABRICATED_ORDER env
If an XIM application does not return the XKeyEvent from XNextEvent() to XFilterEvent(), a timeout is reached and the behavior is fallen back to the previous one with a warning messsage and we can ask the application to send the XKeyEvent to XFilterEvent() but also libX11 provides LIBX11_ENABLE_FABRICATED_ORDER environment variable. If the application runs with LIBX11_ENABLE_FABRICATED_ORDER=0, the previous behavior is available until the application is fixed. Closes: !246 Part-of: <https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/246>
Diffstat (limited to 'modules')
-rw-r--r--modules/im/ximcp/imDefIm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/im/ximcp/imDefIm.c b/modules/im/ximcp/imDefIm.c
index 722ba063..a12d2970 100644
--- a/modules/im/ximcp/imDefIm.c
+++ b/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;
@@ -433,6 +436,13 @@ _XimPreConnect(
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;
}