summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2024-04-05 13:15:32 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2024-04-05 13:18:48 +1000
commit52a191ee096e93cf711f77b6a56c508b68afc0b6 (patch)
tree862a7b8fabb118770e99f1a251a14050304a77dd
parent3ea9f4f769fecbbc8c5210c5833ad83ab8d9e97e (diff)
Revert "ximcp: Unmark to fabricate key events with XKeyEvent serial"
This commit causes a regression, see #205, #206, #207, #208. This reverts commit 024d229fdf88a7755577b01b46af6ef908d599e0.
-rw-r--r--modules/im/ximcp/imDefFlt.c8
-rw-r--r--modules/im/ximcp/imDefIm.c1
-rw-r--r--modules/im/ximcp/imDefLkup.c58
-rw-r--r--src/xlibi18n/XimintP.h17
4 files changed, 9 insertions, 75 deletions
diff --git a/modules/im/ximcp/imDefFlt.c b/modules/im/ximcp/imDefFlt.c
index 834b9db4..44cc6884 100644
--- a/modules/im/ximcp/imDefFlt.c
+++ b/modules/im/ximcp/imDefFlt.c
@@ -142,9 +142,9 @@ _XimProtoKeypressFilter(
{
Xim im = (Xim)ic->core.im;
- if (_XimIsFabricatedSerial(im, ev->serial)) {
+ if (IS_FABRICATED(im)) {
_XimPendingFilter(ic);
- _XimUnfabricateSerial(im, ev->serial);
+ UNMARK_FABRICATED(im);
return NOTFILTERD;
}
@@ -203,9 +203,9 @@ _XimProtoKeyreleaseFilter(
{
Xim im = (Xim)ic->core.im;
- if (_XimIsFabricatedSerial(im, ev->serial)) {
+ if (IS_FABRICATED(im)) {
_XimPendingFilter(ic);
- _XimUnfabricateSerial(im, ev->serial);
+ UNMARK_FABRICATED(im);
return NOTFILTERD;
}
diff --git a/modules/im/ximcp/imDefIm.c b/modules/im/ximcp/imDefIm.c
index ac7f1195..fe4d18ba 100644
--- a/modules/im/ximcp/imDefIm.c
+++ b/modules/im/ximcp/imDefIm.c
@@ -430,7 +430,6 @@ _XimPreConnect(
return False;
im->private.proto.im_window = im_window;
- im->private.proto.fabricated_serial = 0;
return True;
}
diff --git a/modules/im/ximcp/imDefLkup.c b/modules/im/ximcp/imDefLkup.c
index 5192e8c1..dd1adf53 100644
--- a/modules/im/ximcp/imDefLkup.c
+++ b/modules/im/ximcp/imDefLkup.c
@@ -341,54 +341,6 @@ _XimForwardEvent(
return _XimForwardEventCore(ic, ev, sync);
}
-Bool
-_XimFabricateSerial(
- Xim im,
- unsigned long serial)
-{
- if (!serial)
- return False;
- if (serial == im->private.proto.fabricated_serial) {
- fprintf(stderr, "%s,%d: The key event is already fabricated.\n", __FILE__, __LINE__);
- return False;
- }
- if (im->private.proto.fabricated_serial)
- fprintf(stderr, "%s,%d: Tried to fabricate a wrong key event.\n", __FILE__, __LINE__);
-
- MARK_FABRICATED(im);
- im->private.proto.fabricated_serial = serial;
- return True;
-}
-
-Bool
-_XimUnfabricateSerial(
- Xim im,
- unsigned long serial)
-{
- if (!serial)
- return False;
- if (!im->private.proto.fabricated_serial) {
- fprintf(stderr, "%s,%d: The key event is already unfabricated.\n", __FILE__, __LINE__);
- return False;
- }
- if (serial != im->private.proto.fabricated_serial)
- fprintf(stderr, "%s,%d: Tried to unfabricate a wrong key event.\n", __FILE__, __LINE__);
-
- im->private.proto.fabricated_serial = 0;
- UNMARK_FABRICATED(im);
- return True;
-}
-
-Bool
-_XimIsFabricatedSerial(
- Xim im,
- unsigned long serial)
-{
- if (!serial)
- return False;
- return (serial == im->private.proto.fabricated_serial);
-}
-
static void
_XimProcEvent(
Display *d,
@@ -403,7 +355,7 @@ _XimProcEvent(
ev->xany.serial |= serial << 16;
ev->xany.send_event = False;
ev->xany.display = d;
- _XimFabricateSerial((Xim)ic->core.im, ev->xany.serial);
+ MARK_FABRICATED(ic->core.im);
return;
}
@@ -752,6 +704,10 @@ _XimCommitRecv(
(void)_XimRespSyncReply(ic, flag);
+ if (ic->private.proto.registed_filter_event
+ & (KEYPRESS_MASK | KEYRELEASE_MASK))
+ MARK_FABRICATED(im);
+
bzero(&ev, sizeof(ev)); /* uninitialized : found when running kterm under valgrind */
ev.type = KeyPress;
@@ -763,10 +719,6 @@ _XimCommitRecv(
ev.time = 0L;
ev.serial = LastKnownRequestProcessed(im->core.display);
-
- if (ic->private.proto.registed_filter_event
- & (KEYPRESS_MASK | KEYRELEASE_MASK))
- _XimFabricateSerial(im, ev.serial);
/* FIXME :
I wish there were COMMENTs (!) about the data passed around.
*/
diff --git a/src/xlibi18n/XimintP.h b/src/xlibi18n/XimintP.h
index 2a51e2ed..674da029 100644
--- a/src/xlibi18n/XimintP.h
+++ b/src/xlibi18n/XimintP.h
@@ -149,8 +149,6 @@ typedef struct _XimProtoPrivateRec {
XimTransRegDispatcher register_dispatcher;
XimTransCallDispatcher call_dispatcher;
XPointer spec;
-
- unsigned long fabricated_serial;
} XimProtoPrivateRec;
/*
@@ -309,19 +307,4 @@ typedef struct _XicProtoPrivateRec {
#define XIM_MAXIMNAMELEN 64
#define XIM_MAXLCNAMELEN 64
-Bool
-_XimFabricateSerial(
- Xim im,
- unsigned long serial);
-
-Bool
-_XimUnfabricateSerial(
- Xim im,
- unsigned long serial);
-
-Bool
-_XimIsFabricatedSerial(
- Xim im,
- unsigned long serial);
-
#endif /* _XIMINTP_H */