From cc7cb041c4144f1401fd520f05018028c0e0c87e Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Fri, 26 Sep 2008 17:34:50 -0300 Subject: Proper implementation of AddDoubleClickCallback I tracked it down to http://cvsweb.xfree86.org/cvsweb/xc/programs/xedit/commands.c?rev=1.5&content-type=text/vnd.viewcvs-markup After my patches to libXaw. Instead of checking for "if (XtIsSubclass(w, asciiSrcObjectClass)) {" it should really do something like "if (isXaw7orNewer) {". But I believe only XFree86 and Xorg versions of Xaw have the XawVersion macro in XawInit.h... This corrects the problem described in http://bugs.freedesktop.org/show_bug.cgi?id=17726 And the main reason is that xedit always default'ed to use a 8 bits iso8859-x locale, while in Xorg it was modified to use multibyte by default. --- commands.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'commands.c') diff --git a/commands.c b/commands.c index 6940d73..fd66200 100644 --- a/commands.c +++ b/commands.c @@ -93,24 +93,10 @@ static int dc_state; static void AddDoubleClickCallback(Widget w, Bool state) { - Arg args[1]; - static XtCallbackRec cb[] = { {NULL, NULL}, {NULL, NULL} }; - - if (XtIsSubclass(w, asciiSrcObjectClass)) { - if (state) - XtAddCallback(w, XtNcallback, ResetDC, NULL); - else - XtRemoveCallback(w, XtNcallback, ResetDC, NULL); - } - else { - if (state) - cb[0].callback = ResetDC; - else - cb[0].callback = NULL; - - XtSetArg(args[0], XtNcallback, cb); - XtSetValues(w, args, ONE); - } + if (state) + XtAddCallback(w, XtNcallback, ResetDC, NULL); + else + XtRemoveCallback(w, XtNcallback, ResetDC, NULL); } /* Function Name: ResetDC -- cgit v1.2.3