]> git.pld-linux.org Git - packages/XFree86.git/blame - XFree86-xf-4_0_2-branch-2001-02-10.patch
- outdated
[packages/XFree86.git] / XFree86-xf-4_0_2-branch-2001-02-10.patch
CommitLineData
74d9ed7f 1diff -Naur -x CVS xc.orig/config/cf/FreeBSD.cf xc/config/cf/FreeBSD.cf
2--- XFree86-4.0.2.orig/xc/config/cf/FreeBSD.cf Mon Dec 4 13:49:09 2000
3+++ XFree86-4.0.2/xc/config/cf/FreeBSD.cf Mon Jan 22 14:49:12 2001
4@@ -59,6 +59,12 @@
5 #define HasNCurses YES
6 #define HasVarRun YES
7 #define HasVarDb YES
8+
9+#if (OSMajorVersion > 1)
10+#define InstallXloadSetGID NO
11+#else
12+#define InstallXloadSetGID YES
13+#endif
14
15 #define AvoidNullMakeCommand YES
16 #define StripInstalledPrograms YES
17diff -Naur -x CVS xc.orig/config/cf/Imake.rules xc/config/cf/Imake.rules
18--- XFree86-4.0.2.orig/xc/config/cf/Imake.rules Sat Dec 16 12:32:59 2000
19+++ XFree86-4.0.2/xc/config/cf/Imake.rules Sat Jan 27 15:08:17 2001
20@@ -1217,7 +1217,7 @@
21 InstallHtmlManPageAliases(file,aliases,$(MANSUFFIX)) @@\
22 @@\
23 install.man:: @@\
24- @(TMP=/tmp/tmp.$$$$; \ @@\
25+ @(TMP=#tmp.$$$$; \ @@\
26 RemoveFile($${TMP}); \ @@\
27 echo .so `basename destdir`/file.$(MANSUFFIX) > $${TMP}; \ @@\
28 for i in aliases; do (set -x; \ @@\
29@@ -1258,7 +1258,7 @@
30 InstallHtmlManPageAliases(file,aliases,suffix) @@\
31 @@\
32 install.man:: @@\
33- @(TMP=/tmp/tmp.$$$$; \ @@\
34+ @(TMP=#tmp.$$$$; \ @@\
35 RemoveFile($${TMP}); \ @@\
36 echo .so `basename destdir`/file.suffix > $${TMP}; \ @@\
37 for i in aliases; do (set -x; \ @@\
38diff -Naur -x CVS xc.orig/config/cf/NetBSD.cf xc/config/cf/NetBSD.cf
39--- XFree86-4.0.2.orig/xc/config/cf/NetBSD.cf Sun Dec 3 11:14:08 2000
40+++ XFree86-4.0.2/xc/config/cf/NetBSD.cf Mon Jan 22 14:49:14 2001
41@@ -71,6 +71,8 @@
42
43 #define HasVarRun YES
44 #define HasVarDb YES
45+
46+#define InstallXloadSetGID NO
47
48 /* Defines for using the GNU pth thread library -- experimental */
49
50diff -Naur -x CVS xc.orig/config/cf/OpenBSD.cf xc/config/cf/OpenBSD.cf
51--- XFree86-4.0.2.orig/xc/config/cf/OpenBSD.cf Sat Dec 2 15:15:03 2000
52+++ XFree86-4.0.2/xc/config/cf/OpenBSD.cf Mon Jan 22 14:49:15 2001
53@@ -71,6 +71,8 @@
54
55 #define HasVarRun YES
56 #define HasVarDb YES
57+
58+#define InstallXloadSetGID NO
59
60 #ifndef HasLibPthread
61 #define HasLibPthread NO
62diff -Naur -x CVS xc.orig/config/cf/X11.tmpl xc/config/cf/X11.tmpl
63--- XFree86-4.0.2.orig/xc/config/cf/X11.tmpl Sat Dec 16 12:33:01 2000
64+++ XFree86-4.0.2/xc/config/cf/X11.tmpl Mon Jan 22 14:49:17 2001
65@@ -339,6 +339,9 @@
66 #ifndef InstallXtermSetUID
67 #define InstallXtermSetUID YES /* xterm needs to be set uid */
68 #endif
69+#ifndef InstallXloadSetGID
70+#define InstallXloadSetGID YES /* xload often needs set gid kmem */
71+#endif
72 #ifndef InstallXinitConfig
73 #define InstallXinitConfig NO /* install sample xinit config */
74 #endif
75@@ -358,6 +361,12 @@
76 #ifndef InstallAppDefFiles
77 #define InstallAppDefFiles YES /* install application defaults */
78 #endif
79+#ifndef UseConfDirForAppDefaults
80+#define UseConfDirForAppDefaults YES
81+#endif
82+#ifndef UseConfDirForXkb
83+#define UseConfDirForXkb YES
84+#endif
85 #ifndef CompressAllFonts
86 #define CompressAllFonts NO
87 #endif
88@@ -2347,6 +2356,7 @@
89 * if the InstallAppDefFiles configuration parameter is set.
90 */
91 #ifndef InstallAppDefaultsLong
92+#if UseConfDirForAppDefaults
93 #if InstallAppDefFiles
94 #define InstallAppDefaultsLong(file,class) @@\
95 LinkConfDirectory(app-defaults,.,app-defaults,.) @@\
96@@ -2356,6 +2366,15 @@
97 LinkConfDirectory(app-defaults,.,app-defaults,.) @@\
98 InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
99 #endif /* InstallAppDefFiles */
100+#else /* UseConfDirForAppDefaults */
101+#if InstallAppDefFiles
102+#define InstallAppDefaultsLong(file,class) @@\
103+InstallNamedTarget(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
104+#else
105+#define InstallAppDefaultsLong(file,class) @@\
106+InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
107+#endif /* InstallAppDefFiles */
108+#endif /* UseConfDirForAppDefaults */
109 #endif /* InstallAppDefaultsLong */
110
111 /*
112diff -Naur -x CVS xc.orig/config/cf/linux.cf xc/config/cf/linux.cf
113--- XFree86-4.0.2.orig/xc/config/cf/linux.cf Sat Dec 16 12:33:00 2000
114+++ XFree86-4.0.2/xc/config/cf/linux.cf Mon Jan 22 14:49:19 2001
115@@ -215,6 +215,10 @@
116 # ifndef HasLibCrypt
117 # define HasLibCrypt NO
118 # endif
119+#endif
120+
121+#ifndef InstallXloadSetGID
122+#define InstallXloadSetGID NO
123 #endif
124
125 /* <linux/input.h> support mainly for USB support */
126diff -Naur -x CVS xc.orig/config/cf/osf1.cf xc/config/cf/osf1.cf
127--- XFree86-4.0.2.orig/xc/config/cf/osf1.cf Wed Jun 11 08:24:18 1997
128+++ XFree86-4.0.2/xc/config/cf/osf1.cf Mon Jan 22 14:49:23 2001
129@@ -35,6 +35,9 @@
130 #define ShLibDir /usr/shlib
131 #define SharedLibPex NO /* losing, no shared -lm */
132 #endif
133+
134+#define InstallXloadSetGID NO
135+
136 #define ThreadedX ModernOSF1
137
138 #if ThreadedX
139diff -Naur -x CVS xc.orig/config/util/gccmdep.cpp xc/config/util/gccmdep.cpp
140--- XFree86-4.0.2.orig/xc/config/util/gccmdep.cpp Tue Nov 14 16:59:21 2000
141+++ XFree86-4.0.2/xc/config/util/gccmdep.cpp Sat Jan 27 15:07:33 2001
142@@ -14,6 +14,18 @@
143 LN=LNCMD
144 MV=MVCMD
145
146+XCOMM Security: if $tmp exists exit immediately
147+rm -f ${TMP}
148+if [ -e ${TMP} ] ; then
149+ echo "$0: ${TMP} exists already, exit." 1>&2
150+ exit 1;
151+fi
152+#if defined(HAS_MKTEMP)
153+if [ -n "`type -p mktemp`" ] ; then
154+ TMP="`mktemp ${TMP}.XXXXXX`" || exit 1
155+fi
156+#endif
157+
158 trap "$RM ${TMP}*; exit 1" 1 2 15
159 trap "$RM ${TMP}*; exit 0" 1 2 13
160
161@@ -33,7 +45,7 @@
162 -D*|-I*)
163 args="$args '$1'"
164 ;;
165- -g|-O*)
166+ -g|-O)
167 ;;
168 *)
169 if [ "$endmarker"x = x ]; then
170diff -Naur -x CVS xc.orig/extras/rman/rman.c xc/extras/rman/rman.c
171--- XFree86-4.0.2.orig/xc/extras/rman/rman.c Fri Dec 1 13:48:08 2000
172+++ XFree86-4.0.2/xc/extras/rman/rman.c Thu Dec 21 14:01:07 2000
173@@ -474,12 +474,14 @@
174 {
175 char *p0;
176 static char *nonhref = "\">'";
177+ static char *punct = ".,:;)]}?!";
178
179 while (*p==' ') p++;
180 if (strincmp(p,"http",4)==0) {
181 href="%s"; manrefname = p;
182 p+=4;
183 while (*p && !isspace(*p) && !strchr(nonhref,*p)) p++;
184+ while (strchr(punct, *(p - 1))) p--;
185 } else {
186 href = manRef;
187
188diff -Naur -x CVS xc.orig/lib/Xaw/AsciiSrc.c xc/lib/Xaw/AsciiSrc.c
189--- XFree86-4.0.2.orig/xc/lib/Xaw/AsciiSrc.c Tue Nov 28 12:25:09 2000
190+++ XFree86-4.0.2/xc/lib/Xaw/AsciiSrc.c Sat Jan 27 15:06:11 2001
191@@ -1456,7 +1456,7 @@
192 open_mode = O_WRONLY | O_CREAT | O_EXCL;
193 fdopen_mode = "w";
194 }
195- else
196+ else {
197 /* O_NOFOLLOW is a FreeBSD & Linux extension */
198 #ifdef O_NOFOLLOW
199 open_mode = O_RDWR | O_NOFOLLOW;
200@@ -1464,6 +1464,7 @@
201 open_mode = O_RDWR; /* unsafe; subject to race conditions */
202 #endif /* O_NOFOLLOW */
203 fdopen_mode = "r+";
204+ }
205 break;
206 default:
207 XtErrorMsg("badMode", "asciiSourceCreate", "XawError",
208diff -Naur -x CVS xc.orig/lib/Xaw/Form.c xc/lib/Xaw/Form.c
209--- XFree86-4.0.2.orig/xc/lib/Xaw/Form.c Thu Oct 26 13:57:49 2000
210+++ XFree86-4.0.2/xc/lib/Xaw/Form.c Fri Feb 9 21:33:13 2001
211@@ -582,6 +582,11 @@
212 always_resize_children =
213 ChangeFormGeometry((Widget)fw, False, maxx, maxy, NULL, NULL);
214
215+#ifdef OLDXAW
216+ fw->form.old_width = fw->core.width;
217+ fw->form.old_height = fw->core.height;
218+#endif
219+
220 if (force_relayout)
221 ret_val = True;
222 else
223@@ -656,7 +661,6 @@
224 static void
225 LayoutChild(Widget w)
226 {
227- FormWidget fw = (FormWidget)XtParent(w);
228 FormConstraints form = (FormConstraints)w->core.constraints;
229 Widget ref;
230
231@@ -684,22 +688,16 @@
232 form->form.new_y = form->form.dy;
233 if ((ref = form->form.horiz_base) != NULL) {
234 FormConstraints ref_form = (FormConstraints)ref->core.constraints;
235- Dimension width;
236
237 LayoutChild(ref);
238- width = fw->form.old_width ?
239- ref_form->form.virtual_width : XtWidth(ref);
240- form->form.new_x += ref_form->form.new_x + width +
241+ form->form.new_x += ref_form->form.new_x + XtWidth(ref) +
242 (XtBorderWidth(ref) << 1);
243 }
244 if ((ref = form->form.vert_base) != NULL) {
245 FormConstraints ref_form = (FormConstraints)ref->core.constraints;
246- Dimension height;
247
248 LayoutChild(ref);
249- height = fw->form.old_height ?
250- ref_form->form.virtual_height : XtHeight(ref);
251- form->form.new_y += ref_form->form.new_y + height +
252+ form->form.new_y += ref_form->form.new_y + XtHeight(ref) +
253 (XtBorderWidth(ref) << 1);
254 }
255
256@@ -891,8 +889,6 @@
257 * The window will be updated when no_refigure is set back
258 * to False
259 */
260- form->form.virtual_width = XtWidth(w);
261- form->form.virtual_height = XtHeight(w);
262 form->form.deferred_resize = True;
263 ret_val = XtGeometryDone;
264 }
265@@ -902,6 +898,8 @@
266 /*
267 * Resets everything.
268 */
269+ fw->form.old_width = XtWidth(fw);
270+ fw->form.old_height = XtHeight(fw);
271 for (childP = children; childP - children < num_children; childP++) {
272 Widget nw = *childP;
273
274@@ -916,8 +914,6 @@
275 nform->form.virtual_height = XtHeight(nw);
276 }
277 }
278- fw->form.old_width = XtWidth(fw);
279- fw->form.old_height = XtHeight(fw);
280 }
281 else {
282 XtWidth(w) = old_width;
283@@ -1022,23 +1018,21 @@
284 (*((FormWidgetClass)w->core.widget_class)->form_class.layout)
285 (fw, XtWidth(w), XtHeight(w), True);
286
287- if (!fw->form.old_width || !fw->form.old_height) {
288- fw->form.old_width = XtWidth(w);
289- fw->form.old_height = XtHeight(w);
290- for (children = childP = fw->composite.children;
291- childP - children < num_children;
292- childP++) {
293- child = *childP;
294- if (!XtIsManaged(child))
295- continue;
296- form = (FormConstraints)child->core.constraints;
297+ fw->form.old_width = XtWidth(w);
298+ fw->form.old_height = XtHeight(w);
299+ for (children = childP = fw->composite.children;
300+ childP - children < num_children;
301+ childP++) {
302+ child = *childP;
303+ if (!XtIsManaged(child))
304+ continue;
305+ form = (FormConstraints)child->core.constraints;
306 #ifndef OLDXAW
307- form->form.virtual_x = XtX(child);
308- form->form.virtual_y = XtY(child);
309+ form->form.virtual_x = XtX(child);
310+ form->form.virtual_y = XtY(child);
311 #endif
312- form->form.virtual_width = XtWidth(child);
313- form->form.virtual_height = XtHeight(child);
314- }
315+ form->form.virtual_width = XtWidth(child);
316+ form->form.virtual_height = XtHeight(child);
317 }
318 }
319
320diff -Naur -x CVS xc.orig/lib/Xaw/MultiSrc.c xc/lib/Xaw/MultiSrc.c
321--- XFree86-4.0.2.orig/xc/lib/Xaw/MultiSrc.c Mon Jul 19 09:36:02 1999
322+++ XFree86-4.0.2/xc/lib/Xaw/MultiSrc.c Sat Jan 27 15:06:56 2001
323@@ -67,6 +67,10 @@
324 #include "XawI18n.h"
325 #include "Private.h"
326
327+#include <sys/types.h>
328+#include <sys/stat.h>
329+#include <fcntl.h>
330+
331 #define MAGIC_VALUE ((XawTextPosition)-1)
332 #define streq(a, b) (strcmp((a), (b)) == 0)
333
334@@ -1158,7 +1162,9 @@
335 static FILE *
336 InitStringOrFile(MultiSrcObject src, Bool newString)
337 {
338- char *open_mode = NULL;
339+ mode_t open_mode;
340+ const char *fdopen_mode = NULL;
341+ int fd;
342 FILE *file;
343 char fileName[TMPSIZ];
344 Display *d = XtDisplayOfObject((Widget)src);
345@@ -1208,7 +1214,8 @@
346 XtErrorMsg("NoFile", "multiSourceCreate", "XawError",
347 "Creating a read only disk widget and no file specified.",
348 NULL, 0);
349- open_mode = "r";
350+ open_mode = O_RDONLY;
351+ fdopen_mode = "r";
352 break;
353 case XawtextAppend:
354 case XawtextEdit:
355@@ -1218,10 +1225,18 @@
356
357 (void)tmpnam((char *)src->multi_src.string);
358 src->multi_src.is_tempfile = True;
359- open_mode = "w";
360+ open_mode = O_WRONLY | O_CREAT | O_EXCL;
361+ fdopen_mode = "w";
362+ }
363+ else {
364+/* O_NOFOLLOW is a BSD & Linux extension */
365+#ifdef O_NOFOLLOW
366+ open_mode = O_RDWR | O_NOFOLLOW;
367+#else
368+ open_mode = O_RDWR; /* unsafe; subject to race conditions */
369+#endif
370+ fdopen_mode = "r+";
371 }
372- else
373- open_mode = "r+";
374 break;
375 default:
376 XtErrorMsg("badMode", "multiSourceCreate", "XawError",
377@@ -1243,12 +1258,14 @@
378 }
379
380 if (!src->multi_src.is_tempfile) {
381- if ((file = fopen((char *)src->multi_src.string, open_mode)) != NULL) {
382- (void)fseek(file, 0, 2);
383- src->multi_src.length = ftell(file);
384- return file;
385+ if ((fd = open((char *)src->multi_src.string, open_mode, 0666)) != 0) {
386+ if ((file = fdopen(fd, fdopen_mode)) != NULL) {
387+ (void)fseek(file, 0, SEEK_END);
388+ src->multi_src.length = (XawTextPosition)ftell(file);
389+ return(file);
390+ }
391 }
392- else {
393+ {
394 String params[2];
395 Cardinal num_params = 2;
396
397@@ -1258,7 +1275,7 @@
398 "openError", "multiSourceCreate", "XawWarning",
399 "Cannot open file %s; %s", params, &num_params);
400 }
401- }
402+ }
403 src->multi_src.length = 0;
404 return (NULL);
405 }
406diff -Naur -x CVS xc.orig/lib/Xaw/Pixmap.c xc/lib/Xaw/Pixmap.c
407--- XFree86-4.0.2.orig/xc/lib/Xaw/Pixmap.c Tue Sep 26 11:56:54 2000
408+++ XFree86-4.0.2/xc/lib/Xaw/Pixmap.c Fri Feb 9 21:33:13 2001
409@@ -437,7 +437,7 @@
410 cache = (XawCache **)bsearch(screen, xaw->elems,
411 xaw->num_elems, sizeof(XtPointer),
412 bcmp_long);
413- if (!cache)
414+ if (!cache || !(*cache)->num_elems)
415 return (NULL);
416 if (flags == FIND_SCREEN)
417 return (*cache);
418@@ -446,7 +446,7 @@
419 cache = (XawCache **)bsearch((void *)colormap, (*cache)->elems,
420 (*cache)->num_elems, sizeof(XtPointer),
421 bcmp_long);
422- if (!cache)
423+ if (!cache || !(*cache)->num_elems)
424 return (NULL);
425 if (flags == FIND_COLORMAP)
426 return (*cache);
427@@ -456,7 +456,7 @@
428 (*cache)->num_elems, sizeof(XtPointer),
429 bcmp_long);
430
431- if (!cache)
432+ if (!cache || !(*cache)->num_elems)
433 return (NULL);
434 return (*cache);
435 }
436diff -Naur -x CVS xc.orig/lib/Xaw/Text.c xc/lib/Xaw/Text.c
437--- XFree86-4.0.2.orig/xc/lib/Xaw/Text.c Thu Dec 7 15:26:12 2000
438+++ XFree86-4.0.2/xc/lib/Xaw/Text.c Fri Feb 9 21:33:13 2001
439@@ -805,6 +805,7 @@
440 XtRealizeWidget(vbar);
441 XtMapWidget(vbar);
442 }
443+ XtSetKeyboardFocus(vbar, (Widget)ctx);
444 }
445
446 /*
447@@ -863,6 +864,7 @@
448 XtRealizeWidget(hbar);
449 XtMapWidget(hbar);
450 }
451+ XtSetKeyboardFocus(hbar, (Widget)ctx);
452 }
453
454 /*
455diff -Naur -x CVS xc.orig/lib/Xaw/TextAction.c xc/lib/Xaw/TextAction.c
456--- XFree86-4.0.2.orig/xc/lib/Xaw/TextAction.c Thu Dec 7 15:26:12 2000
457+++ XFree86-4.0.2/xc/lib/Xaw/TextAction.c Fri Feb 9 21:33:13 2001
458@@ -2835,12 +2835,23 @@
459 EndAction((TextWidget)w);
460 }
461
462+/* This is kind of a hack, but, only one text widget can have focus at
463+ * a time on one display. There is a problem in the implementation of the
464+ * text widget, the scrollbars can not be adressed via editres, since they
465+ * are not children of a subclass of composite.
466+ * The focus variable is required to make sure only one text window will
467+ * show a block cursor at one time.
468+ */
469+struct _focus { Display *display; Widget widget; };
470+static struct _focus *focus;
471+static Cardinal num_focus;
472 /*ARGSUSED*/
473 static void
474 TextFocusIn(Widget w, XEvent *event, String *p, Cardinal *n)
475 {
476 TextWidget ctx = (TextWidget)w;
477 Bool display_caret = ctx->text.display_caret;
478+ int i;
479
480 if (event->xfocus.detail == NotifyPointer)
481 return;
482@@ -2853,6 +2864,25 @@
483 ctx->text.hasfocus = TRUE;
484 if (display_caret)
485 EndAction(ctx);
486+
487+ for (i = 0; i < num_focus; i++)
488+ if (focus[i].display == XtDisplay(w))
489+ break;
490+ if (i >= num_focus) {
491+ focus = (struct _focus*)
492+ XtRealloc((XtPointer)focus, sizeof(struct _focus) * (num_focus + 1));
493+ i = num_focus;
494+ focus[i].widget = w;
495+ focus[i].display = XtDisplay(w);
496+ num_focus++;
497+ }
498+ if (focus[i].widget != w) {
499+ Widget old = focus[i].widget;
500+
501+ focus[i].widget = w;
502+ if (old != NULL)
503+ TextFocusOut(old, event, p, n);
504+ }
505 }
506
507 /*ARGSUSED*/
508@@ -2861,8 +2891,24 @@
509 {
510 TextWidget ctx = (TextWidget)w;
511 Bool display_caret = ctx->text.display_caret;
512+ Widget shell;
513+ Window window;
514+ int i, revert;
515+
516+ shell = w;
517+ while (shell) {
518+ if (XtIsShell(shell))
519+ break;
520+ shell = XtParent(shell);
521+ }
522
523- if (event->xfocus.detail == NotifyPointer)
524+ for (i = 0; i < num_focus; i++)
525+ if (focus[i].display == XtDisplay(w))
526+ break;
527+ XGetInputFocus(XtDisplay(w), &window, &revert);
528+ if ((XtWindow(shell) == window &&
529+ (i < num_focus && focus[i].widget == w))
530+ || event->xfocus.detail == NotifyPointer)
531 return;
532
533 /* Let the input method know focus has left.*/
534@@ -3110,6 +3156,8 @@
535 FD_ZERO(&fds);
536 FD_SET(ConnectionNumber(XtDisplay(w)), &fds);
537 (void)select(FD_SETSIZE, &fds, NULL, NULL, &tmval);
538+ if (tmval.tv_usec != 500000)
539+ usleep(40000);
540
541 StartAction(ctx, NULL);
542 #ifndef OLDXAW
543@@ -3342,8 +3390,9 @@
544 return;
545 }
546 else {
547- mult = mult * 10 + params[0][0] - '0';
548- ctx->text.mult = ctx->text.mult * 10 + params[0][0] - '0';
549+ mult = mult * 10 + (params[0][0] - '0') * (mult < 0 ? -1 : 1);
550+ ctx->text.mult = ctx->text.mult * 10 + (params[0][0] - '0') *
551+ (mult < 0 ? -1 : 1);
552 }
553 if (mult != ctx->text.mult || mult >= 32767) { /* checks for overflow */
554 XBell(XtDisplay(w), 0);
555diff -Naur -x CVS xc.orig/lib/Xaw/TextPop.c xc/lib/Xaw/TextPop.c
556--- XFree86-4.0.2.orig/xc/lib/Xaw/TextPop.c Thu May 18 12:29:52 2000
557+++ XFree86-4.0.2/xc/lib/Xaw/TextPop.c Fri Feb 9 21:33:13 2001
558@@ -837,7 +837,7 @@
559 static Bool
560 DoSearch(struct SearchAndReplace *search)
561 {
562- char msg[BUFSIZ];
563+ char msg[37];
564 Widget tw = XtParent(search->search_popup);
565 XawTextPosition pos;
566 XawTextScanDirection dir;
567@@ -875,11 +875,27 @@
568 GetString to get a tame version */
569
570 if (pos == XawTextSearchError) {
571- (void)XmuSnprintf(msg, sizeof(msg),
572- "Could not find string ``%s''.",
573- GetString(search->search_text));
574+ char *ptr;
575+ int len;
576+
577+ ptr = GetString(search->search_text);
578+ len = strlen(ptr);
579+ (void)XmuSnprintf(msg, sizeof(msg), "%s", ptr);
580+
581+ ptr = strchr(msg, '\n');
582+ if (ptr != NULL || sizeof(msg) - 1 < len) {
583+ if (ptr != NULL)
584+ len = ptr - msg + 4;
585+ else
586+ len = strlen(msg);
587+
588+ if (len < 4)
589+ strcpy(msg, "...");
590+ else
591+ strcpy(msg + len - 4, "...");
592+ }
593 XawTextUnsetSelection(tw);
594- SetSearchLabels(search, msg, "", True);
595+ SetSearchLabels(search, "Could not find string", msg, True);
596
597 return (False);
598 }
599@@ -1019,15 +1035,26 @@
600
601 if (new_pos == XawTextSearchError) {
602 if (count == 0) {
603- char msg[BUFSIZ];
604-
605- /* The Raw string in find.ptr may be WC I can't use here,
606- so I call GetString to get a tame version */
607-
608- (void)XmuSnprintf(msg, sizeof(msg),
609- "Error: Could not find string ``%s''",
610- GetString(search->search_text));
611- SetSearchLabels(search, msg, "", True);
612+ char msg[37];
613+ char *ptr;
614+ int len;
615+
616+ ptr = GetString(search->search_text);
617+ len = strlen(ptr);
618+ (void)XmuSnprintf(msg, sizeof(msg), "%s", ptr);
619+ ptr = strchr(msg, '\n');
620+ if (ptr != NULL || sizeof(msg) - 1 < len) {
621+ if (ptr != NULL)
622+ len = ptr - msg + 4;
623+ else
624+ len = strlen(msg);
625+
626+ if (len < 4)
627+ strcpy(msg, "...");
628+ else
629+ strcpy(msg + len - 4, "...");
630+ }
631+ SetSearchLabels(search, "Could not find string", msg, True);
632
633 if (redisplay) {
634 XawTextSetInsertionPoint(tw, ipos);
635@@ -1047,7 +1074,7 @@
636 XawTextGetSelectionPos(tw, &pos, &end_pos);
637
638 if (search->selection_changed) {
639- SetSearchLabels(search, "Selection has been modified, aborting.",
640+ SetSearchLabels(search, "Selection modified, aborting.",
641 "", True);
642 if (redisplay) {
643 XawTextSetInsertionPoint(tw, ipos);
644@@ -1067,11 +1094,7 @@
645 }
646
647 if (XawTextReplace(tw, pos, end_pos, &replace) != XawEditDone) {
648- char msg[BUFSIZ];
649-
650- (void)XmuSnprintf(msg, sizeof(msg),
651- "'%s' with '%s'", find.ptr, replace.ptr);
652- SetSearchLabels(search, "Error while replacing", msg, True);
653+ SetSearchLabels(search, "Error while replacing.", "", True);
654 if (redisplay) {
655 XawTextSetInsertionPoint(tw, ipos);
656 XawTextEnableRedisplay(tw);
657diff -Naur -x CVS xc.orig/lib/Xaw/TextSrc.c xc/lib/Xaw/TextSrc.c
658--- XFree86-4.0.2.orig/xc/lib/Xaw/TextSrc.c Tue Sep 26 11:56:55 2000
659+++ XFree86-4.0.2/xc/lib/Xaw/TextSrc.c Fri Feb 9 21:33:13 2001
660@@ -1022,9 +1022,9 @@
661 XtFree((XtPointer)entity);
662 if (entity == anchor->entities) {
663 if ((anchor->entities = enext) == NULL) {
664+ eprev = NULL;
665 anchor = XawTextSourceRemoveAnchor(w, anchor);
666 entity = anchor ? anchor->entities : NULL;
667- eprev = NULL;
668 }
669 else
670 eprev = entity = enext;
671@@ -1053,6 +1053,7 @@
672 XtFree((XtPointer)entity);
673 anchor->cache = NULL;
674 if (entity == anchor->entities) {
675+ eprev = NULL;
676 if ((anchor->entities = enext) == NULL) {
677 if (i == 0)
678 ++i;
679@@ -1069,7 +1070,6 @@
680 break;
681 }
682 anchor = src->textSrc.anchors[i];
683- eprev = NULL;
684 entity = anchor->entities;
685 continue;
686 }
687diff -Naur -x CVS xc.orig/programs/Xserver/dix/events.c xc/programs/Xserver/dix/events.c
688--- XFree86-4.0.2.orig/xc/programs/Xserver/dix/events.c Sun Oct 22 17:12:09 2000
689+++ XFree86-4.0.2/xc/programs/Xserver/dix/events.c Fri Feb 9 21:33:13 2001
690@@ -2783,6 +2783,44 @@
691 if (deactivateGrab)
692 (*keybd->DeactivateGrab)(keybd);
693 }
694+
695+#ifdef XKB
696+/* This function is used to set the key pressed or key released state -
697+ this is only used when the pressing of keys does not cause
698+ CoreProcessKeyEvent to be called, as in for example Mouse Keys.
699+*/
700+void
701+FixKeyState (xE, keybd)
702+ register xEvent *xE;
703+ register DeviceIntPtr keybd;
704+{
705+ int key, bit;
706+ register BYTE *kptr;
707+ register KeyClassPtr keyc = keybd->key;
708+
709+ key = xE->u.u.detail;
710+ kptr = &keyc->down[key >> 3];
711+ bit = 1 << (key & 7);
712+#ifdef DEBUG
713+ if ((xkbDebugFlags&0x4)&&
714+ ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) {
715+ ErrorF("FixKeyState: Key %d %s\n",key,
716+ (xE->u.u.type==KeyPress?"down":"up"));
717+ }
718+#endif
719+ switch (xE->u.u.type)
720+ {
721+ case KeyPress:
722+ *kptr |= bit;
723+ break;
724+ case KeyRelease:
725+ *kptr &= ~bit;
726+ break;
727+ default:
728+ FatalError("Impossible keyboard event");
729+ }
730+}
731+#endif
732
733 void
734 #ifdef XKB
735diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/CHANGELOG xc/programs/Xserver/hw/xfree86/CHANGELOG
736--- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/CHANGELOG Tue Dec 19 08:12:29 2000
737+++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/CHANGELOG Sat Feb 10 09:37:49 2001
738@@ -1,3 +1,40 @@
739+XFree86 4.0.2a (?? February 2001)
740+1224. Make acceleration work on the Trident Cyber9388 (Alan Hourihane).
741+1223. Make some changes to the clock selection for trident driver
742+ (Alan Hourihane).
743+1222. Ensure Video is unavailable when no acceleration available in the
744+ trident driver (Alan Hourihane).
745+1221. Allow xf86ClaimPciSlot to be called with a NULL GDevPtr, as it was
746+ previously (Alan Hourihane).
747+1220. Correct some problems with xedit c-mode. Fix geometry management
748+ incompatibilites with Xaw 6 in the Form widget.
749+ Fix problem in libxf86config when comparing float and double and
750+ small fix to xf86cfg when converting a HorizSync or VertRefresh
751+ specification string to format used internally by libxf86config.
752+ Adds dvorak keyboard and fixes Ukranian in rules/xfree86.lst.
753+ Fix problems in the xkb interface of xf86cfg and fix autorepeat with
754+ MouseKeys, based on patches and suggestion of Stephen Montgomery-Smith
755