Commit bec22fe9 authored by Yann Droneaud's avatar Yann Droneaud Committed by Ulrich Sibiller

Return name instead of value in XGetIMValues() and XSetIMValues()

As stated in man page (XOpenIM) and Xlib documentation (chapter 13.5.3), XGetIMValues() and XSetImValues() "returns the name of the first argument that could not be obtained." But currently, err = XGetIMValues(im, "invalid", &arg, NULL); returns &arg instead of "invalid". This patch fixes https://bugs.freedesktop.org/show_bug.cgi?id=12897Signed-off-by: 's avatarYann Droneaud <yann@droneaud.fr> Reviewed-by: 's avatarJeremy Huddleston <jeremyhu@apple.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent cded3305
......@@ -2250,17 +2250,17 @@ _XimSetIMValueData(
for(p = values; p->name != NULL; p++) {
if(!(res = _XimGetResourceListRec(res_list, list_num, p->name))) {
return p->value;
return p->name;
}
check = _XimCheckIMMode(res, XIM_SETIMVALUES);
if(check == XIM_CHECK_INVALID) {
continue;
} else if (check == XIM_CHECK_ERROR) {
return p->value;
return p->name;
}
if(!_XimEncodeLocalIMAttr(res, top, p->value)) {
return p->value;
return p->name;
}
}
return NULL;
......@@ -2280,17 +2280,17 @@ _XimGetIMValueData(
for(p = values; p->name != NULL; p++) {
if(!(res = _XimGetResourceListRec(res_list, list_num, p->name))) {
return p->value;
return p->name;
}
check = _XimCheckIMMode(res, XIM_GETIMVALUES);
if(check == XIM_CHECK_INVALID) {
continue;
} else if (check == XIM_CHECK_ERROR) {
return p->value;
return p->name;
}
if(!_XimDecodeLocalIMAttr(res, top, p->value)) {
return p->value;
return p->name;
}
}
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment