mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-01 12:38:02 +02:00
Revert "imDefLkup: Commit first info in XimCommitInfo"
This commit causes a regression, see #205, #206, #207, #208.
This reverts commit 041b5291f0.
This commit is contained in:
parent
9afd55ada5
commit
3ea9f4f769
1 changed files with 16 additions and 54 deletions
|
|
@ -639,46 +639,21 @@ _XimRegCommitInfo(
|
|||
return True;
|
||||
}
|
||||
|
||||
static void
|
||||
_XimUnregRealCommitInfo(
|
||||
Xic ic,
|
||||
Bool reverse)
|
||||
{
|
||||
XimCommitInfo info;
|
||||
XimCommitInfo prev_info = NULL;
|
||||
|
||||
info = ic->private.proto.commit_info;
|
||||
while (reverse && info) {
|
||||
if (!info->next)
|
||||
break;
|
||||
prev_info = info;
|
||||
info = info->next;
|
||||
}
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
Xfree(info->string);
|
||||
Xfree(info->keysym);
|
||||
if (prev_info)
|
||||
prev_info->next = info->next;
|
||||
else
|
||||
ic->private.proto.commit_info = info->next;
|
||||
Xfree(info);
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
_XimUnregCommitInfo(
|
||||
Xic ic)
|
||||
{
|
||||
_XimUnregRealCommitInfo(ic, False);
|
||||
}
|
||||
XimCommitInfo info;
|
||||
|
||||
static void
|
||||
_XimUnregFirstCommitInfo(
|
||||
Xic ic)
|
||||
{
|
||||
_XimUnregRealCommitInfo(ic, True);
|
||||
if (!(info = ic->private.proto.commit_info))
|
||||
return;
|
||||
|
||||
|
||||
Xfree(info->string);
|
||||
Xfree(info->keysym);
|
||||
ic->private.proto.commit_info = info->next;
|
||||
Xfree(info);
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -690,19 +665,6 @@ _XimFreeCommitInfo(
|
|||
return;
|
||||
}
|
||||
|
||||
static XimCommitInfo
|
||||
_XimFirstCommitInfo(
|
||||
Xic ic)
|
||||
{
|
||||
XimCommitInfo info = ic->private.proto.commit_info;
|
||||
while (info) {
|
||||
if (!info->next)
|
||||
break;
|
||||
info = info->next;
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
static Bool
|
||||
_XimProcKeySym(
|
||||
Xic ic,
|
||||
|
|
@ -1097,7 +1059,7 @@ _XimProtoMbLookupString(
|
|||
state = &tmp_state;
|
||||
|
||||
if ((ev->type == KeyPress) && (ev->keycode == 0)) { /* Filter function */
|
||||
if (!(info = _XimFirstCommitInfo(ic))) {
|
||||
if (!(info = ic->private.proto.commit_info)) {
|
||||
*state = XLookupNone;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1113,7 +1075,7 @@ _XimProtoMbLookupString(
|
|||
else
|
||||
*state = XLookupKeySym;
|
||||
}
|
||||
_XimUnregFirstCommitInfo(ic);
|
||||
_XimUnregCommitInfo(ic);
|
||||
|
||||
} else if (ev->type == KeyPress) {
|
||||
ret = _XimLookupMBText(ic, ev, buffer, bytes, keysym, NULL);
|
||||
|
|
@ -1160,7 +1122,7 @@ _XimProtoWcLookupString(
|
|||
state = &tmp_state;
|
||||
|
||||
if (ev->type == KeyPress && ev->keycode == 0) { /* Filter function */
|
||||
if (!(info = _XimFirstCommitInfo(ic))) {
|
||||
if (!(info = ic->private.proto.commit_info)) {
|
||||
*state = XLookupNone;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1176,7 +1138,7 @@ _XimProtoWcLookupString(
|
|||
else
|
||||
*state = XLookupKeySym;
|
||||
}
|
||||
_XimUnregFirstCommitInfo(ic);
|
||||
_XimUnregCommitInfo(ic);
|
||||
|
||||
} else if (ev->type == KeyPress) {
|
||||
ret = _XimLookupWCText(ic, ev, buffer, bytes, keysym, NULL);
|
||||
|
|
@ -1223,7 +1185,7 @@ _XimProtoUtf8LookupString(
|
|||
state = &tmp_state;
|
||||
|
||||
if (ev->type == KeyPress && ev->keycode == 0) { /* Filter function */
|
||||
if (!(info = _XimFirstCommitInfo(ic))) {
|
||||
if (!(info = ic->private.proto.commit_info)) {
|
||||
*state = XLookupNone;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1239,7 +1201,7 @@ _XimProtoUtf8LookupString(
|
|||
else
|
||||
*state = XLookupKeySym;
|
||||
}
|
||||
_XimUnregFirstCommitInfo(ic);
|
||||
_XimUnregCommitInfo(ic);
|
||||
|
||||
} else if (ev->type == KeyPress) {
|
||||
ret = _XimLookupUTF8Text(ic, ev, buffer, bytes, keysym, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue