diff -Naur -x CVS xc.orig/config/cf/FreeBSD.cf xc/config/cf/FreeBSD.cf --- XFree86-4.0.2.orig/xc/config/cf/FreeBSD.cf Mon Dec 4 13:49:09 2000 +++ XFree86-4.0.2/xc/config/cf/FreeBSD.cf Mon Jan 22 14:49:12 2001 @@ -59,6 +59,12 @@ #define HasNCurses YES #define HasVarRun YES #define HasVarDb YES + +#if (OSMajorVersion > 1) +#define InstallXloadSetGID NO +#else +#define InstallXloadSetGID YES +#endif #define AvoidNullMakeCommand YES #define StripInstalledPrograms YES diff -Naur -x CVS xc.orig/config/cf/Imake.rules xc/config/cf/Imake.rules --- XFree86-4.0.2.orig/xc/config/cf/Imake.rules Sat Dec 16 12:32:59 2000 +++ XFree86-4.0.2/xc/config/cf/Imake.rules Sat Jan 27 15:08:17 2001 @@ -1217,7 +1217,7 @@ InstallHtmlManPageAliases(file,aliases,$(MANSUFFIX)) @@\ @@\ install.man:: @@\ - @(TMP=/tmp/tmp.$$$$; \ @@\ + @(TMP=#tmp.$$$$; \ @@\ RemoveFile($${TMP}); \ @@\ echo .so `basename destdir`/file.$(MANSUFFIX) > $${TMP}; \ @@\ for i in aliases; do (set -x; \ @@\ @@ -1258,7 +1258,7 @@ InstallHtmlManPageAliases(file,aliases,suffix) @@\ @@\ install.man:: @@\ - @(TMP=/tmp/tmp.$$$$; \ @@\ + @(TMP=#tmp.$$$$; \ @@\ RemoveFile($${TMP}); \ @@\ echo .so `basename destdir`/file.suffix > $${TMP}; \ @@\ for i in aliases; do (set -x; \ @@\ diff -Naur -x CVS xc.orig/config/cf/NetBSD.cf xc/config/cf/NetBSD.cf --- XFree86-4.0.2.orig/xc/config/cf/NetBSD.cf Sun Dec 3 11:14:08 2000 +++ XFree86-4.0.2/xc/config/cf/NetBSD.cf Mon Jan 22 14:49:14 2001 @@ -71,6 +71,8 @@ #define HasVarRun YES #define HasVarDb YES + +#define InstallXloadSetGID NO /* Defines for using the GNU pth thread library -- experimental */ diff -Naur -x CVS xc.orig/config/cf/OpenBSD.cf xc/config/cf/OpenBSD.cf --- XFree86-4.0.2.orig/xc/config/cf/OpenBSD.cf Sat Dec 2 15:15:03 2000 +++ XFree86-4.0.2/xc/config/cf/OpenBSD.cf Mon Jan 22 14:49:15 2001 @@ -71,6 +71,8 @@ #define HasVarRun YES #define HasVarDb YES + +#define InstallXloadSetGID NO #ifndef HasLibPthread #define HasLibPthread NO diff -Naur -x CVS xc.orig/config/cf/X11.tmpl xc/config/cf/X11.tmpl --- XFree86-4.0.2.orig/xc/config/cf/X11.tmpl Sat Dec 16 12:33:01 2000 +++ XFree86-4.0.2/xc/config/cf/X11.tmpl Mon Jan 22 14:49:17 2001 @@ -339,6 +339,9 @@ #ifndef InstallXtermSetUID #define InstallXtermSetUID YES /* xterm needs to be set uid */ #endif +#ifndef InstallXloadSetGID +#define InstallXloadSetGID YES /* xload often needs set gid kmem */ +#endif #ifndef InstallXinitConfig #define InstallXinitConfig NO /* install sample xinit config */ #endif @@ -358,6 +361,12 @@ #ifndef InstallAppDefFiles #define InstallAppDefFiles YES /* install application defaults */ #endif +#ifndef UseConfDirForAppDefaults +#define UseConfDirForAppDefaults YES +#endif +#ifndef UseConfDirForXkb +#define UseConfDirForXkb YES +#endif #ifndef CompressAllFonts #define CompressAllFonts NO #endif @@ -2347,6 +2356,7 @@ * if the InstallAppDefFiles configuration parameter is set. */ #ifndef InstallAppDefaultsLong +#if UseConfDirForAppDefaults #if InstallAppDefFiles #define InstallAppDefaultsLong(file,class) @@\ LinkConfDirectory(app-defaults,.,app-defaults,.) @@\ @@ -2356,6 +2366,15 @@ LinkConfDirectory(app-defaults,.,app-defaults,.) @@\ InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class) #endif /* InstallAppDefFiles */ +#else /* UseConfDirForAppDefaults */ +#if InstallAppDefFiles +#define InstallAppDefaultsLong(file,class) @@\ +InstallNamedTarget(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class) +#else +#define InstallAppDefaultsLong(file,class) @@\ +InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class) +#endif /* InstallAppDefFiles */ +#endif /* UseConfDirForAppDefaults */ #endif /* InstallAppDefaultsLong */ /* diff -Naur -x CVS xc.orig/config/cf/linux.cf xc/config/cf/linux.cf --- XFree86-4.0.2.orig/xc/config/cf/linux.cf Sat Dec 16 12:33:00 2000 +++ XFree86-4.0.2/xc/config/cf/linux.cf Mon Jan 22 14:49:19 2001 @@ -215,6 +215,10 @@ # ifndef HasLibCrypt # define HasLibCrypt NO # endif +#endif + +#ifndef InstallXloadSetGID +#define InstallXloadSetGID NO #endif /* support mainly for USB support */ diff -Naur -x CVS xc.orig/config/cf/osf1.cf xc/config/cf/osf1.cf --- XFree86-4.0.2.orig/xc/config/cf/osf1.cf Wed Jun 11 08:24:18 1997 +++ XFree86-4.0.2/xc/config/cf/osf1.cf Mon Jan 22 14:49:23 2001 @@ -35,6 +35,9 @@ #define ShLibDir /usr/shlib #define SharedLibPex NO /* losing, no shared -lm */ #endif + +#define InstallXloadSetGID NO + #define ThreadedX ModernOSF1 #if ThreadedX diff -Naur -x CVS xc.orig/config/util/gccmdep.cpp xc/config/util/gccmdep.cpp --- XFree86-4.0.2.orig/xc/config/util/gccmdep.cpp Tue Nov 14 16:59:21 2000 +++ XFree86-4.0.2/xc/config/util/gccmdep.cpp Sat Jan 27 15:07:33 2001 @@ -14,6 +14,18 @@ LN=LNCMD MV=MVCMD +XCOMM Security: if $tmp exists exit immediately +rm -f ${TMP} +if [ -e ${TMP} ] ; then + echo "$0: ${TMP} exists already, exit." 1>&2 + exit 1; +fi +#if defined(HAS_MKTEMP) +if [ -n "`type -p mktemp`" ] ; then + TMP="`mktemp ${TMP}.XXXXXX`" || exit 1 +fi +#endif + trap "$RM ${TMP}*; exit 1" 1 2 15 trap "$RM ${TMP}*; exit 0" 1 2 13 @@ -33,7 +45,7 @@ -D*|-I*) args="$args '$1'" ;; - -g|-O*) + -g|-O) ;; *) if [ "$endmarker"x = x ]; then diff -Naur -x CVS xc.orig/extras/rman/rman.c xc/extras/rman/rman.c --- XFree86-4.0.2.orig/xc/extras/rman/rman.c Fri Dec 1 13:48:08 2000 +++ XFree86-4.0.2/xc/extras/rman/rman.c Thu Dec 21 14:01:07 2000 @@ -474,12 +474,14 @@ { char *p0; static char *nonhref = "\">'"; + static char *punct = ".,:;)]}?!"; while (*p==' ') p++; if (strincmp(p,"http",4)==0) { href="%s"; manrefname = p; p+=4; while (*p && !isspace(*p) && !strchr(nonhref,*p)) p++; + while (strchr(punct, *(p - 1))) p--; } else { href = manRef; diff -Naur -x CVS xc.orig/lib/Xaw/AsciiSrc.c xc/lib/Xaw/AsciiSrc.c --- XFree86-4.0.2.orig/xc/lib/Xaw/AsciiSrc.c Tue Nov 28 12:25:09 2000 +++ XFree86-4.0.2/xc/lib/Xaw/AsciiSrc.c Sat Jan 27 15:06:11 2001 @@ -1456,7 +1456,7 @@ open_mode = O_WRONLY | O_CREAT | O_EXCL; fdopen_mode = "w"; } - else + else { /* O_NOFOLLOW is a FreeBSD & Linux extension */ #ifdef O_NOFOLLOW open_mode = O_RDWR | O_NOFOLLOW; @@ -1464,6 +1464,7 @@ open_mode = O_RDWR; /* unsafe; subject to race conditions */ #endif /* O_NOFOLLOW */ fdopen_mode = "r+"; + } break; default: XtErrorMsg("badMode", "asciiSourceCreate", "XawError", diff -Naur -x CVS xc.orig/lib/Xaw/Form.c xc/lib/Xaw/Form.c --- XFree86-4.0.2.orig/xc/lib/Xaw/Form.c Thu Oct 26 13:57:49 2000 +++ XFree86-4.0.2/xc/lib/Xaw/Form.c Fri Feb 9 21:33:13 2001 @@ -582,6 +582,11 @@ always_resize_children = ChangeFormGeometry((Widget)fw, False, maxx, maxy, NULL, NULL); +#ifdef OLDXAW + fw->form.old_width = fw->core.width; + fw->form.old_height = fw->core.height; +#endif + if (force_relayout) ret_val = True; else @@ -656,7 +661,6 @@ static void LayoutChild(Widget w) { - FormWidget fw = (FormWidget)XtParent(w); FormConstraints form = (FormConstraints)w->core.constraints; Widget ref; @@ -684,22 +688,16 @@ form->form.new_y = form->form.dy; if ((ref = form->form.horiz_base) != NULL) { FormConstraints ref_form = (FormConstraints)ref->core.constraints; - Dimension width; LayoutChild(ref); - width = fw->form.old_width ? - ref_form->form.virtual_width : XtWidth(ref); - form->form.new_x += ref_form->form.new_x + width + + form->form.new_x += ref_form->form.new_x + XtWidth(ref) + (XtBorderWidth(ref) << 1); } if ((ref = form->form.vert_base) != NULL) { FormConstraints ref_form = (FormConstraints)ref->core.constraints; - Dimension height; LayoutChild(ref); - height = fw->form.old_height ? - ref_form->form.virtual_height : XtHeight(ref); - form->form.new_y += ref_form->form.new_y + height + + form->form.new_y += ref_form->form.new_y + XtHeight(ref) + (XtBorderWidth(ref) << 1); } @@ -891,8 +889,6 @@ * The window will be updated when no_refigure is set back * to False */ - form->form.virtual_width = XtWidth(w); - form->form.virtual_height = XtHeight(w); form->form.deferred_resize = True; ret_val = XtGeometryDone; } @@ -902,6 +898,8 @@ /* * Resets everything. */ + fw->form.old_width = XtWidth(fw); + fw->form.old_height = XtHeight(fw); for (childP = children; childP - children < num_children; childP++) { Widget nw = *childP; @@ -916,8 +914,6 @@ nform->form.virtual_height = XtHeight(nw); } } - fw->form.old_width = XtWidth(fw); - fw->form.old_height = XtHeight(fw); } else { XtWidth(w) = old_width; @@ -1022,23 +1018,21 @@ (*((FormWidgetClass)w->core.widget_class)->form_class.layout) (fw, XtWidth(w), XtHeight(w), True); - if (!fw->form.old_width || !fw->form.old_height) { - fw->form.old_width = XtWidth(w); - fw->form.old_height = XtHeight(w); - for (children = childP = fw->composite.children; - childP - children < num_children; - childP++) { - child = *childP; - if (!XtIsManaged(child)) - continue; - form = (FormConstraints)child->core.constraints; + fw->form.old_width = XtWidth(w); + fw->form.old_height = XtHeight(w); + for (children = childP = fw->composite.children; + childP - children < num_children; + childP++) { + child = *childP; + if (!XtIsManaged(child)) + continue; + form = (FormConstraints)child->core.constraints; #ifndef OLDXAW - form->form.virtual_x = XtX(child); - form->form.virtual_y = XtY(child); + form->form.virtual_x = XtX(child); + form->form.virtual_y = XtY(child); #endif - form->form.virtual_width = XtWidth(child); - form->form.virtual_height = XtHeight(child); - } + form->form.virtual_width = XtWidth(child); + form->form.virtual_height = XtHeight(child); } } diff -Naur -x CVS xc.orig/lib/Xaw/MultiSrc.c xc/lib/Xaw/MultiSrc.c --- XFree86-4.0.2.orig/xc/lib/Xaw/MultiSrc.c Mon Jul 19 09:36:02 1999 +++ XFree86-4.0.2/xc/lib/Xaw/MultiSrc.c Sat Jan 27 15:06:56 2001 @@ -67,6 +67,10 @@ #include "XawI18n.h" #include "Private.h" +#include +#include +#include + #define MAGIC_VALUE ((XawTextPosition)-1) #define streq(a, b) (strcmp((a), (b)) == 0) @@ -1158,7 +1162,9 @@ static FILE * InitStringOrFile(MultiSrcObject src, Bool newString) { - char *open_mode = NULL; + mode_t open_mode; + const char *fdopen_mode = NULL; + int fd; FILE *file; char fileName[TMPSIZ]; Display *d = XtDisplayOfObject((Widget)src); @@ -1208,7 +1214,8 @@ XtErrorMsg("NoFile", "multiSourceCreate", "XawError", "Creating a read only disk widget and no file specified.", NULL, 0); - open_mode = "r"; + open_mode = O_RDONLY; + fdopen_mode = "r"; break; case XawtextAppend: case XawtextEdit: @@ -1218,10 +1225,18 @@ (void)tmpnam((char *)src->multi_src.string); src->multi_src.is_tempfile = True; - open_mode = "w"; + open_mode = O_WRONLY | O_CREAT | O_EXCL; + fdopen_mode = "w"; + } + else { +/* O_NOFOLLOW is a BSD & Linux extension */ +#ifdef O_NOFOLLOW + open_mode = O_RDWR | O_NOFOLLOW; +#else + open_mode = O_RDWR; /* unsafe; subject to race conditions */ +#endif + fdopen_mode = "r+"; } - else - open_mode = "r+"; break; default: XtErrorMsg("badMode", "multiSourceCreate", "XawError", @@ -1243,12 +1258,14 @@ } if (!src->multi_src.is_tempfile) { - if ((file = fopen((char *)src->multi_src.string, open_mode)) != NULL) { - (void)fseek(file, 0, 2); - src->multi_src.length = ftell(file); - return file; + if ((fd = open((char *)src->multi_src.string, open_mode, 0666)) != 0) { + if ((file = fdopen(fd, fdopen_mode)) != NULL) { + (void)fseek(file, 0, SEEK_END); + src->multi_src.length = (XawTextPosition)ftell(file); + return(file); + } } - else { + { String params[2]; Cardinal num_params = 2; @@ -1258,7 +1275,7 @@ "openError", "multiSourceCreate", "XawWarning", "Cannot open file %s; %s", params, &num_params); } - } + } src->multi_src.length = 0; return (NULL); } diff -Naur -x CVS xc.orig/lib/Xaw/Pixmap.c xc/lib/Xaw/Pixmap.c --- XFree86-4.0.2.orig/xc/lib/Xaw/Pixmap.c Tue Sep 26 11:56:54 2000 +++ XFree86-4.0.2/xc/lib/Xaw/Pixmap.c Fri Feb 9 21:33:13 2001 @@ -437,7 +437,7 @@ cache = (XawCache **)bsearch(screen, xaw->elems, xaw->num_elems, sizeof(XtPointer), bcmp_long); - if (!cache) + if (!cache || !(*cache)->num_elems) return (NULL); if (flags == FIND_SCREEN) return (*cache); @@ -446,7 +446,7 @@ cache = (XawCache **)bsearch((void *)colormap, (*cache)->elems, (*cache)->num_elems, sizeof(XtPointer), bcmp_long); - if (!cache) + if (!cache || !(*cache)->num_elems) return (NULL); if (flags == FIND_COLORMAP) return (*cache); @@ -456,7 +456,7 @@ (*cache)->num_elems, sizeof(XtPointer), bcmp_long); - if (!cache) + if (!cache || !(*cache)->num_elems) return (NULL); return (*cache); } diff -Naur -x CVS xc.orig/lib/Xaw/Text.c xc/lib/Xaw/Text.c --- XFree86-4.0.2.orig/xc/lib/Xaw/Text.c Thu Dec 7 15:26:12 2000 +++ XFree86-4.0.2/xc/lib/Xaw/Text.c Fri Feb 9 21:33:13 2001 @@ -805,6 +805,7 @@ XtRealizeWidget(vbar); XtMapWidget(vbar); } + XtSetKeyboardFocus(vbar, (Widget)ctx); } /* @@ -863,6 +864,7 @@ XtRealizeWidget(hbar); XtMapWidget(hbar); } + XtSetKeyboardFocus(hbar, (Widget)ctx); } /* diff -Naur -x CVS xc.orig/lib/Xaw/TextAction.c xc/lib/Xaw/TextAction.c --- XFree86-4.0.2.orig/xc/lib/Xaw/TextAction.c Thu Dec 7 15:26:12 2000 +++ XFree86-4.0.2/xc/lib/Xaw/TextAction.c Fri Feb 9 21:33:13 2001 @@ -2835,12 +2835,23 @@ EndAction((TextWidget)w); } +/* This is kind of a hack, but, only one text widget can have focus at + * a time on one display. There is a problem in the implementation of the + * text widget, the scrollbars can not be adressed via editres, since they + * are not children of a subclass of composite. + * The focus variable is required to make sure only one text window will + * show a block cursor at one time. + */ +struct _focus { Display *display; Widget widget; }; +static struct _focus *focus; +static Cardinal num_focus; /*ARGSUSED*/ static void TextFocusIn(Widget w, XEvent *event, String *p, Cardinal *n) { TextWidget ctx = (TextWidget)w; Bool display_caret = ctx->text.display_caret; + int i; if (event->xfocus.detail == NotifyPointer) return; @@ -2853,6 +2864,25 @@ ctx->text.hasfocus = TRUE; if (display_caret) EndAction(ctx); + + for (i = 0; i < num_focus; i++) + if (focus[i].display == XtDisplay(w)) + break; + if (i >= num_focus) { + focus = (struct _focus*) + XtRealloc((XtPointer)focus, sizeof(struct _focus) * (num_focus + 1)); + i = num_focus; + focus[i].widget = w; + focus[i].display = XtDisplay(w); + num_focus++; + } + if (focus[i].widget != w) { + Widget old = focus[i].widget; + + focus[i].widget = w; + if (old != NULL) + TextFocusOut(old, event, p, n); + } } /*ARGSUSED*/ @@ -2861,8 +2891,24 @@ { TextWidget ctx = (TextWidget)w; Bool display_caret = ctx->text.display_caret; + Widget shell; + Window window; + int i, revert; + + shell = w; + while (shell) { + if (XtIsShell(shell)) + break; + shell = XtParent(shell); + } - if (event->xfocus.detail == NotifyPointer) + for (i = 0; i < num_focus; i++) + if (focus[i].display == XtDisplay(w)) + break; + XGetInputFocus(XtDisplay(w), &window, &revert); + if ((XtWindow(shell) == window && + (i < num_focus && focus[i].widget == w)) + || event->xfocus.detail == NotifyPointer) return; /* Let the input method know focus has left.*/ @@ -3110,6 +3156,8 @@ FD_ZERO(&fds); FD_SET(ConnectionNumber(XtDisplay(w)), &fds); (void)select(FD_SETSIZE, &fds, NULL, NULL, &tmval); + if (tmval.tv_usec != 500000) + usleep(40000); StartAction(ctx, NULL); #ifndef OLDXAW @@ -3342,8 +3390,9 @@ return; } else { - mult = mult * 10 + params[0][0] - '0'; - ctx->text.mult = ctx->text.mult * 10 + params[0][0] - '0'; + mult = mult * 10 + (params[0][0] - '0') * (mult < 0 ? -1 : 1); + ctx->text.mult = ctx->text.mult * 10 + (params[0][0] - '0') * + (mult < 0 ? -1 : 1); } if (mult != ctx->text.mult || mult >= 32767) { /* checks for overflow */ XBell(XtDisplay(w), 0); diff -Naur -x CVS xc.orig/lib/Xaw/TextPop.c xc/lib/Xaw/TextPop.c --- XFree86-4.0.2.orig/xc/lib/Xaw/TextPop.c Thu May 18 12:29:52 2000 +++ XFree86-4.0.2/xc/lib/Xaw/TextPop.c Fri Feb 9 21:33:13 2001 @@ -837,7 +837,7 @@ static Bool DoSearch(struct SearchAndReplace *search) { - char msg[BUFSIZ]; + char msg[37]; Widget tw = XtParent(search->search_popup); XawTextPosition pos; XawTextScanDirection dir; @@ -875,11 +875,27 @@ GetString to get a tame version */ if (pos == XawTextSearchError) { - (void)XmuSnprintf(msg, sizeof(msg), - "Could not find string ``%s''.", - GetString(search->search_text)); + char *ptr; + int len; + + ptr = GetString(search->search_text); + len = strlen(ptr); + (void)XmuSnprintf(msg, sizeof(msg), "%s", ptr); + + ptr = strchr(msg, '\n'); + if (ptr != NULL || sizeof(msg) - 1 < len) { + if (ptr != NULL) + len = ptr - msg + 4; + else + len = strlen(msg); + + if (len < 4) + strcpy(msg, "..."); + else + strcpy(msg + len - 4, "..."); + } XawTextUnsetSelection(tw); - SetSearchLabels(search, msg, "", True); + SetSearchLabels(search, "Could not find string", msg, True); return (False); } @@ -1019,15 +1035,26 @@ if (new_pos == XawTextSearchError) { if (count == 0) { - char msg[BUFSIZ]; - - /* The Raw string in find.ptr may be WC I can't use here, - so I call GetString to get a tame version */ - - (void)XmuSnprintf(msg, sizeof(msg), - "Error: Could not find string ``%s''", - GetString(search->search_text)); - SetSearchLabels(search, msg, "", True); + char msg[37]; + char *ptr; + int len; + + ptr = GetString(search->search_text); + len = strlen(ptr); + (void)XmuSnprintf(msg, sizeof(msg), "%s", ptr); + ptr = strchr(msg, '\n'); + if (ptr != NULL || sizeof(msg) - 1 < len) { + if (ptr != NULL) + len = ptr - msg + 4; + else + len = strlen(msg); + + if (len < 4) + strcpy(msg, "..."); + else + strcpy(msg + len - 4, "..."); + } + SetSearchLabels(search, "Could not find string", msg, True); if (redisplay) { XawTextSetInsertionPoint(tw, ipos); @@ -1047,7 +1074,7 @@ XawTextGetSelectionPos(tw, &pos, &end_pos); if (search->selection_changed) { - SetSearchLabels(search, "Selection has been modified, aborting.", + SetSearchLabels(search, "Selection modified, aborting.", "", True); if (redisplay) { XawTextSetInsertionPoint(tw, ipos); @@ -1067,11 +1094,7 @@ } if (XawTextReplace(tw, pos, end_pos, &replace) != XawEditDone) { - char msg[BUFSIZ]; - - (void)XmuSnprintf(msg, sizeof(msg), - "'%s' with '%s'", find.ptr, replace.ptr); - SetSearchLabels(search, "Error while replacing", msg, True); + SetSearchLabels(search, "Error while replacing.", "", True); if (redisplay) { XawTextSetInsertionPoint(tw, ipos); XawTextEnableRedisplay(tw); diff -Naur -x CVS xc.orig/lib/Xaw/TextSrc.c xc/lib/Xaw/TextSrc.c --- XFree86-4.0.2.orig/xc/lib/Xaw/TextSrc.c Tue Sep 26 11:56:55 2000 +++ XFree86-4.0.2/xc/lib/Xaw/TextSrc.c Fri Feb 9 21:33:13 2001 @@ -1022,9 +1022,9 @@ XtFree((XtPointer)entity); if (entity == anchor->entities) { if ((anchor->entities = enext) == NULL) { + eprev = NULL; anchor = XawTextSourceRemoveAnchor(w, anchor); entity = anchor ? anchor->entities : NULL; - eprev = NULL; } else eprev = entity = enext; @@ -1053,6 +1053,7 @@ XtFree((XtPointer)entity); anchor->cache = NULL; if (entity == anchor->entities) { + eprev = NULL; if ((anchor->entities = enext) == NULL) { if (i == 0) ++i; @@ -1069,7 +1070,6 @@ break; } anchor = src->textSrc.anchors[i]; - eprev = NULL; entity = anchor->entities; continue; } diff -Naur -x CVS xc.orig/programs/Xserver/dix/events.c xc/programs/Xserver/dix/events.c --- XFree86-4.0.2.orig/xc/programs/Xserver/dix/events.c Sun Oct 22 17:12:09 2000 +++ XFree86-4.0.2/xc/programs/Xserver/dix/events.c Fri Feb 9 21:33:13 2001 @@ -2783,6 +2783,44 @@ if (deactivateGrab) (*keybd->DeactivateGrab)(keybd); } + +#ifdef XKB +/* This function is used to set the key pressed or key released state - + this is only used when the pressing of keys does not cause + CoreProcessKeyEvent to be called, as in for example Mouse Keys. +*/ +void +FixKeyState (xE, keybd) + register xEvent *xE; + register DeviceIntPtr keybd; +{ + int key, bit; + register BYTE *kptr; + register KeyClassPtr keyc = keybd->key; + + key = xE->u.u.detail; + kptr = &keyc->down[key >> 3]; + bit = 1 << (key & 7); +#ifdef DEBUG + if ((xkbDebugFlags&0x4)&& + ((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) { + ErrorF("FixKeyState: Key %d %s\n",key, + (xE->u.u.type==KeyPress?"down":"up")); + } +#endif + switch (xE->u.u.type) + { + case KeyPress: + *kptr |= bit; + break; + case KeyRelease: + *kptr &= ~bit; + break; + default: + FatalError("Impossible keyboard event"); + } +} +#endif void #ifdef XKB diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/CHANGELOG xc/programs/Xserver/hw/xfree86/CHANGELOG --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/CHANGELOG Tue Dec 19 08:12:29 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/CHANGELOG Sat Feb 10 09:37:49 2001 @@ -1,3 +1,40 @@ +XFree86 4.0.2a (?? February 2001) +1224. Make acceleration work on the Trident Cyber9388 (Alan Hourihane). +1223. Make some changes to the clock selection for trident driver + (Alan Hourihane). +1222. Ensure Video is unavailable when no acceleration available in the + trident driver (Alan Hourihane). +1221. Allow xf86ClaimPciSlot to be called with a NULL GDevPtr, as it was + previously (Alan Hourihane). +1220. Correct some problems with xedit c-mode. Fix geometry management + incompatibilites with Xaw 6 in the Form widget. + Fix problem in libxf86config when comparing float and double and + small fix to xf86cfg when converting a HorizSync or VertRefresh + specification string to format used internally by libxf86config. + Adds dvorak keyboard and fixes Ukranian in rules/xfree86.lst. + Fix problems in the xkb interface of xf86cfg and fix autorepeat with + MouseKeys, based on patches and suggestion of Stephen Montgomery-Smith + (Paulo César Pereira de Andrade). +1219. Undo s3virge changes in 4.0.2 for Xv support on ViRGE chipsets since + they caused problems with plain ViRGE cards. Xv is still supported + for the ViRGE DX (#4414, 4430, Kevin Brosius). +1218. Fix incorrect driverName fields in the cyrix, i810 and sis drivers. + This was causing 'XFree86 -configure' to get the driver name wrong. + Also fix the documentation of this field in the DESIGN doc (David Dawes). +1217. [SECURITY] Fix temp files vulnerabilites in xman on systems with + mkstemp(). (Matthieu Herrb). +1216. [SECURITY] Fix temp vulnerabilities in Xaw/MultiSrc.c using the technique + in patch #4279 (Branden Robinson). Fix temp file vulnerability in + gccmakedep based on report from Alan Cox. Fix temp file vulnerability + in Imake.rules, InstallManPageAliases (Matthieu Herrb). +1215. Fix Neomagic 2200 screen corruption (Egbert Eich). +1214. Add an imake control for determining when xload should be installed + set-gid (David Dawes). +1213. Add some imake controls for installing Xkb and app-defaults files + in the traditional location rather than under /etc/X11 (Red Hat does + that) (David Dawes). +1212. Misc bindist updates. + XFree86 4.0.2 (18 December 2000) 1211. Fix a problem introduced recently when using the "ps/2" protocol for mice on FreeBSD (David Dawes). diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/common/xf86Bus.c xc/programs/Xserver/hw/xfree86/common/xf86Bus.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c Wed Dec 6 10:35:07 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c Sat Feb 10 09:37:49 2001 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.56 2000/12/06 15:35:07 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.56.2.1 2001/02/10 10:23:53 alanh Exp $ */ /* * Copyright (c) 1997-1999 by The XFree86 Project, Inc. */ @@ -443,7 +443,8 @@ pEnt->chipset = xf86Entities[entityIndex]->chipset; pEnt->resources = xf86Entities[entityIndex]->resources; pEnt->driver = xf86Entities[entityIndex]->driver; - if (xf86Entities[entityIndex]->devices[0]) { + if ( (xf86Entities[entityIndex]->devices) && + (xf86Entities[entityIndex]->devices[0]) ) { for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++) if (xf86Entities[entityIndex]->devices[i]->screen == 0) break; @@ -469,7 +470,8 @@ int i; /* We might not use AddDevtoEntity */ - if (!xf86Entities[entityIndex]->devices[0]) + if ( (!xf86Entities[entityIndex]->devices) || + (!xf86Entities[entityIndex]->devices[0]) ) return NULL; if (entityIndex >= xf86NumEntities || diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/common/xf86pciBus.c xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c Fri Dec 8 15:13:35 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c Sat Feb 10 09:37:49 2001 @@ -2343,7 +2343,8 @@ p->pciBusId.func = func; p->active = active; p->inUse = FALSE; - xf86AddDevToEntity(num, dev); + if (dev) + xf86AddDevToEntity(num, dev); /* Here we initialize the access structure */ p->access = xnfcalloc(1,sizeof(EntityAccessRec)); while (ppaccp && *ppaccp) { diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/doc/BugReport xc/programs/Xserver/hw/xfree86/doc/BugReport --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/doc/BugReport Thu Aug 3 08:24:02 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/doc/BugReport Tue Dec 19 13:13:35 2000 @@ -5,7 +5,7 @@ VERSION: -4.0.1a +4.0.2 VIDEO DRIVER: @@ -54,4 +54,4 @@ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/BugReport,v 1.3 2000/08/03 12:24:02 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/BugReport,v 1.3.2.1 2000/12/19 18:13:35 dawes Exp $ diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/doc/DESIGN xc/programs/Xserver/hw/xfree86/doc/DESIGN --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/doc/DESIGN Mon Dec 4 14:47:21 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/doc/DESIGN Fri Feb 9 21:33:14 2001 @@ -408,12 +408,12 @@ points required during the early phase of InitOutput(). xf86AddDriver() adds it to the global xf86DriverList[] array. -The DriverRec contains the driver's version, a short descriptive message, the -Identify(), Probe() and AvailableOptions() function entry points as well as a -pointer to the driver's module (as returned from the loader when the driver -was loaded) and a reference count which keeps track of how many screens are -using the driver. The entry driver entry points are those required prior to -the driver allocating and filling in its ScrnInfoRec. +The DriverRec contains the driver canonical name, the Identify(), Probe() and +AvailableOptions() function entry points as well as a pointer to the driver's +module (as returned from the loader when the driver was loaded) and a refer- +ence count which keeps track of how many screens are using the driver. The +entry driver entry points are those required prior to the driver allocating +and filling in its ScrnInfoRec. For a static server, the xf86DriverList[] array is initialised at build time, and the loading of modules is not done. @@ -5368,7 +5368,7 @@ DriverRec ZZZ = { VERSION, - "unaccelerated driver for ZZZ Zzzzzy cards", + ZZZ_DRIVER_NAME, ZZZIdentify, ZZZProbe, ZZZAvailableOptions, diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml Mon Dec 4 13:49:54 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml Fri Feb 9 21:33:14 2001 @@ -517,8 +517,8 @@ &s.code;InitOutput()&e.code;. &s.code;xf86AddDriver()&e.code; adds it to the global &s.code;xf86DriverList[]&e.code; array. - The &s.code;DriverRec&e.code; contains the driver's version, a short - descriptive message, the &s.code;Identify()&e.code;, + The &s.code;DriverRec&e.code; contains the driver canonical name, + the &s.code;Identify()&e.code;, &s.code;Probe()&e.code; and &s.code;AvailableOptions()&e.code; function entry points as well as a pointer to the driver's module (as returned from the loader when the driver @@ -6336,7 +6336,7 @@ DriverRec ZZZ = { VERSION, - "unaccelerated driver for ZZZ Zzzzzy cards", + ZZZ_DRIVER_NAME, ZZZIdentify, ZZZProbe, ZZZAvailableOptions, diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/doc/sgml/README.sgml xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml Sat Dec 16 12:33:01 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml Fri Feb 9 21:33:14 2001 @@ -31,8 +31,22 @@ What is XFree86 &relvers;?

-XFree86 &relvers; is the third full release in the -XFree86 4 series. + XFree86 +4 series. + +Update releases are taken from a stable/maintenance branch. They are +designed to be installed on top of the full release that they are +updating. They contain fixes for serious problems, most commonly +fixes for security issues, fixes for driver bugs, and fixes that improve +stability. +]]> + + XFree86 4 series. +]]>

XFree86 release 4 is a major re-design of the basic architectural @@ -47,9 +61,10 @@ The road to XFree86 release 4 began as an architectural concept in mid 1997, with the serious framework being implemented in code the beginning of 1998. There were several snapshots on the road to 4.0 which are now -part of the 4.0 base release. The &relvers; version is an upgrade to +part of the 4.0 base release. + Release 4 also included the long-awaited integration of the DRI (Direct Rendering Infrastructure). This upgrade into the code base gives @@ -195,113 +210,134 @@ obtaining the release in source form is given below. ]]> -The source for version &relvers; is split into three tarballs: -X&srcvers;src-1.tgz, X&srcvers;src-2.tgz, -X&srcvers;src-3.tgz. The first contains everything except the +&prevrelvers;-&relvers;.diff.gz. + +The patch +should be applied to a clean &prevrelvers; source tree, working from +the directory containing the xc/ directory. The patch should +be applied by running: + + +gzip -d < &prevrelvers;-&relvers;.diff.gz | patch -p0 -E + + +Information about getting the source for &prevrelvers can be found in the +README file for that version, which can be found on the +. +. +]]> + +X&fullsrcvers;src-1.tgz, X&fullsrcvers;src-2.tgz, +X&fullsrcvers;src-3.tgz. The first contains everything except the fonts and general X11 documentation. It is sufficient for building XFree86 is you already have a set of fonts. The second contains the fonts and the source for the general X11 documentation. The third contains the general X11 documentation in hardcopy format. &prevrelvers;-&relvers;.diff.gz. +A source patch relative to version &prevfullrelvers; is also available. +The patch file is &prevfullrelvers;-&fullrelvers;.diff.gz. &relvers;.tgz. +can't be included in a diff. It is &fullrelvers;.tgz. ]]> The patch -should be applied to a clean &prevrelvers; source tree, working from +should be applied to a clean &prevfullrelvers; source tree, working from the directory containing the xc/ directory. The patch should be applied by running: -gzip -d < &prevrelvers;-&relvers;.diff.gz | patch -p0 -E +gzip -d < &prevfullrelvers;-&fullrelvers;.diff.gz | patch -p0 -E -gzip -d < &relvers;.tgz | tar vxf - +gzip -d < &fullrelvers;.tgz | tar vxf - ]]> ]]> &prevrelvers;-&relvers;.diff1.gz and -&prevrelvers;-&relvers;.diff2.gz. +The patch files are &prevfullrelvers;-&fullrelvers;.diff1.gz and +&prevfullrelvers;-&fullrelvers;.diff2.gz. &relvers;.tgz. +can't be included in a diff. It is &fullrelvers;.tgz. ]]> These patches should -be applied to a clean &prevrelvers; source tree, working from the directory +be applied to a clean &prevfullrelvers; source tree, working from the directory containing the xc/ directory. The patches should be applied by running: -gzip -d < &prevrelvers;-&relvers;.diff1.gz | patch -p0 -E -gzip -d < &prevrelvers;-&relvers;.diff2.gz | patch -p0 -E +gzip -d < &prevfullrelvers;-&fullrelvers;.diff1.gz | patch -p0 -E +gzip -d < &prevfullrelvers;-&fullrelvers;.diff2.gz | patch -p0 -E -gzip -d < &relvers;.tgz | tar vxf - +gzip -d < &fullrelvers;.tgz | tar vxf - ]]> ]]> &prevrelvers;-&relvers;.diff1.gz, -&prevrelvers;-&relvers;.diff2.gz and -&prevrelvers;-&relvers;.diff3.gz. +The patch files are &prevfullrelvers;-&fullrelvers;.diff1.gz, +&prevfullrelvers;-&fullrelvers;.diff2.gz and +&prevfullrelvers;-&fullrelvers;.diff3.gz. &relvers;.tgz. +can't be included in a diff. It is &fullrelvers;.tgz. ]]> These patches should -be applied to a clean &prevrelvers; source tree, working from the directory +be applied to a clean &prevfullrelvers; source tree, working from the directory containing the xc/ directory. The patches should be applied by running: -gzip -d < &prevrelvers;-&relvers;.diff1.gz | patch -p0 -E -gzip -d < &prevrelvers;-&relvers;.diff2.gz | patch -p0 -E -gzip -d < &prevrelvers;-&relvers;.diff3.gz | patch -p0 -E +gzip -d < &prevfullrelvers;-&fullrelvers;.diff1.gz | patch -p0 -E +gzip -d < &prevfullrelvers;-&fullrelvers;.diff2.gz | patch -p0 -E +gzip -d < &prevfullrelvers;-&fullrelvers;.diff3.gz | patch -p0 -E -gzip -d < &relvers;.tgz | tar vxf - +gzip -d < &fullrelvers;.tgz | tar vxf - ]]> ]]> &prevrelvers;-&relvers;.diff1.gz, -&prevrelvers;-&relvers;.diff2.gz, -&prevrelvers;-&relvers;.diff3.gz and -&prevrelvers;-&relvers;.diff4.gz. +The patch files are &prevfullrelvers;-&fullrelvers;.diff1.gz, +&prevfullrelvers;-&fullrelvers;.diff2.gz, +&prevfullrelvers;-&fullrelvers;.diff3.gz and +&prevfullrelvers;-&fullrelvers;.diff4.gz. &relvers;.tgz. +can't be included in a diff. It is &fullrelvers;.tgz. ]]> These patches should -be applied to a clean &prevrelvers; source tree, working from the directory +be applied to a clean &prevfullrelvers; source tree, working from the directory containing the xc/ directory. The patches should be applied by running: -gzip -d < &prevrelvers;-&relvers;.diff1.gz | patch -p0 -E -gzip -d < &prevrelvers;-&relvers;.diff2.gz | patch -p0 -E -gzip -d < &prevrelvers;-&relvers;.diff3.gz | patch -p0 -E -gzip -d < &prevrelvers;-&relvers;.diff4.gz | patch -p0 -E +gzip -d < &prevfullrelvers;-&fullrelvers;.diff1.gz | patch -p0 -E +gzip -d < &prevfullrelvers;-&fullrelvers;.diff2.gz | patch -p0 -E +gzip -d < &prevfullrelvers;-&fullrelvers;.diff3.gz | patch -p0 -E +gzip -d < &prevfullrelvers;-&fullrelvers;.diff4.gz | patch -p0 -E -gzip -d < &relvers;.tgz | tar vxf - +gzip -d < &fullrelvers;.tgz | tar vxf - ]]> ]]> @@ -311,6 +347,7 @@ To format the XFree86 documentation use the latest version of our doctools package available as doctools-&doctoolsvers;.tgz. +]]> Reporting Bugs

diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c Sat Dec 2 10:30:37 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c Fri Feb 9 21:33:14 2001 @@ -112,7 +112,7 @@ DriverRec CYRIX = { VERSION, - "accelerated driver for Cyrix integrated processors", + CYRIX_DRIVER_NAME, CYRIXIdentify, CYRIXProbe, CYRIXAvailableOptions, diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c Sat Dec 2 10:30:42 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c Fri Feb 9 21:33:14 2001 @@ -92,7 +92,7 @@ DriverRec I810 = { I810_VERSION, - "Accelerated driver for Intel i810 cards", + I810_DRIVER_NAME, I810Identify, I810Probe, I810AvailableOptions, diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2200.c xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2200.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2200.c Tue Oct 17 17:36:15 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2200.c Mon Jan 22 14:59:11 2001 @@ -337,8 +337,8 @@ NEOACLPtr nAcl = NEOACLPTR(pScrn); if ((dstY < srcY) || ((dstY == srcY) && (dstX < srcX))) { - if (((dstX < 64) && ((srcX + w) == pScrn->displayWidth)) || - ((dstX == 0) && (w > (pScrn->displayWidth - 64)))) { + if ((((dstX < 64) && ((srcX + w) == pScrn->displayWidth)) || + ((dstX == 0) && (w > (pScrn->displayWidth - 64)))) && (w > 64)) { int srcX1 = srcX + 64; int dstX1 = dstX + 64; @@ -368,9 +368,9 @@ OUTREG(NEOREG_XYEXT, (h<<16) | (w & 0xffff)); } } else { - if ((((dstX + w) > (pScrn->displayWidth - 64)) && (srcX == 0)) + if (((((dstX + w) > (pScrn->displayWidth - 64)) && (srcX == 0)) || (((dstX + w) == pScrn->displayWidth) - && (w > (pScrn->displayWidth - 64)))) { + && (w > (pScrn->displayWidth - 64)))) && (w > 64)) { int srcX1, dstX1; w -= 64; diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/s3virge/TODO_NOTES xc/programs/Xserver/hw/xfree86/drivers/s3virge/TODO_NOTES --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/s3virge/TODO_NOTES Tue Nov 28 15:59:17 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/s3virge/TODO_NOTES Fri Feb 9 21:33:14 2001 @@ -1,7 +1,7 @@ S3 ViRGE 4.0 devel notes rev: -27 Nov 2000 KJB +3 Jan 2001 KJB Function Implemented @@ -23,6 +23,11 @@ Status ------ +1/03/01 KJB +Ver 1.6.0 +Revert ViRGE to pre-Xv changes. ViRGE DX still supports Xv, but changes +added for Xv and ViRGE caused problems with normal display. + 11/27/00 KJB Ver 1.5.0 Clean up, bump version for 4.0.2 submission. diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c Sat Dec 16 12:33:00 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c Fri Feb 9 21:33:14 2001 @@ -116,9 +116,9 @@ #define S3VIRGE_NAME "S3VIRGE" #define S3VIRGE_DRIVER_NAME "s3virge" -#define S3VIRGE_VERSION_NAME "1.5.0" +#define S3VIRGE_VERSION_NAME "1.6.0" #define S3VIRGE_VERSION_MAJOR 1 -#define S3VIRGE_VERSION_MINOR 5 +#define S3VIRGE_VERSION_MINOR 6 #define S3VIRGE_PATCHLEVEL 0 #define S3VIRGE_DRIVER_VERSION ((S3VIRGE_VERSION_MAJOR << 24) | \ (S3VIRGE_VERSION_MINOR << 16) | \ @@ -3073,7 +3073,7 @@ S3VCommonCalcClock(dclk, 1, 1, 31, 0, 4, 230000, 460000, &new->SR13, &new->SR12); } /* end TRIO_3D if() */ - else { /* Is this correct for DX/GX as well? */ + else if(ps3v->Chipset == S3_ViRGE_DXGX) { if (pScrn->bitsPerPixel == 8) { if(dclk > 80000) { /* We need pixmux */ new->CR67 = 0x10; @@ -3110,7 +3110,39 @@ } S3VCommonCalcClock(dclk, 1, 1, 31, 0, 3, 135000, 270000, &new->SR13, &new->SR12); - } + } /* end DXGX if() */ + else { /* Everything else ... (only ViRGE) */ + if (pScrn->bitsPerPixel == 8) { + if(dclk > 80000) { /* We need pixmux */ + new->CR67 = 0x10; + new->SR15 |= 0x10; /* Set DCLK/2 bit */ + new->SR18 = 0x80; /* Enable pixmux */ + } + } + else if ((pScrn->bitsPerPixel == 16) && (pScrn->weight.green == 5)) { + new->CR67 = 0x30; /* 15bpp */ + } + else if (pScrn->bitsPerPixel == 16) { + new->CR67 = 0x50; + } + else if (pScrn->bitsPerPixel == 24) { + new->CR67 = 0xd0 | 0x0c; + /* Flag STREAMS proc. required */ + ps3v->NeedSTREAMS = TRUE; + S3VInitSTREAMS(pScrn, new->STREAMS, mode); + new->MMPR0 = 0xc000; /* Adjust FIFO slots */ + } + else if (pScrn->bitsPerPixel == 32) { + new->CR67 = 0xd0 | 0x0c; + /* Flag STREAMS proc. required */ + ps3v->NeedSTREAMS = TRUE; + S3VInitSTREAMS(pScrn, new->STREAMS, mode); + new->MMPR0 = 0x10000; /* Still more FIFO slots */ + } + S3VCommonCalcClock(dclk, 1, 1, 31, 0, 3, + 135000, 270000, &new->SR13, &new->SR12); + } /* end great big if()... */ + /* Now adjust the value of the FIFO based upon options specified */ if( ps3v->fifo_moderate ) { diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c Tue Nov 28 15:59:18 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_xv.c Fri Feb 9 21:33:14 2001 @@ -106,9 +106,9 @@ (pScrn->bitsPerPixel == 16) ) && - ((ps3v->Chipset == S3_ViRGE_DXGX) || + ((ps3v->Chipset == S3_ViRGE_DXGX) /* || */ /* S3_ViRGE_GX2_SERIES(ps3v->Chipset) || */ - (ps3v->Chipset == S3_ViRGE) + /* (ps3v->Chipset == S3_ViRGE) */ ) && !ps3v->NoAccel ) diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c Sat Dec 2 10:30:51 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c Fri Feb 9 21:33:14 2001 @@ -117,7 +117,7 @@ DriverRec SIS = { SIS_CURRENT_VERSION, - "accelerated driver for SiS chipsets", + SIS_DRIVER_NAME, SISIdentify, SISProbe, SISAvailableOptions, diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/trident/trident.h xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h Fri Dec 8 04:05:16 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h Sat Feb 10 09:37:50 2001 @@ -266,8 +266,7 @@ #define HAS_DST_TRANS ((pTrident->Chipset == PROVIDIA9682) || \ (pTrident->Chipset == PROVIDIA9685)) -#define Is3Dchip ((pTrident->Chipset == CYBER9388) || \ - (pTrident->Chipset == CYBER9397) || \ +#define Is3Dchip ((pTrident->Chipset == CYBER9397) || \ (pTrident->Chipset == CYBER9397DVD) || \ (pTrident->Chipset == CYBER9520) || \ (pTrident->Chipset == CYBER9525DVD) || \ diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c Thu Dec 7 11:48:04 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c Sat Feb 10 09:37:50 2001 @@ -158,7 +158,8 @@ infoPtr->SubsequentScreenToScreenCopy = TridentSubsequentScreenToScreenCopy; - if (!(pTrident->Chipset == PROVIDIA9685 && pScrn->bitsPerPixel > 8)) { + if (!((pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) && pScrn->bitsPerPixel > 8)) { infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK | HARDWARE_PATTERN_SCREEN_ORIGIN | BIT_ORDER_IN_BYTE_MSBFIRST; @@ -282,7 +283,8 @@ REPLICATE(transparency_color); if (transparency_color != -1) { - if (pTrident->Chipset == PROVIDIA9685) { + if (pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) { dst |= 1<<16; } else { TGUI_OPERMODE(pTrident->EngineOperation | DST_ENABLE); @@ -294,7 +296,8 @@ if ((pTrident->Chipset == PROVIDIA9682) || (pTrident->Chipset == TGUI9680)) dst |= FASTMODE; - if (pTrident->Chipset == PROVIDIA9685) + if (pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) dst |= 1<<21; } @@ -332,7 +335,8 @@ pTrident->BltScanDirection = 0; REPLICATE(color); TGUI_FMIX(XAAPatternROP[rop]); - if (pTrident->Chipset == PROVIDIA9685) { + if (pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) { TGUI_FPATCOL(color); if (rop == GXcopy) pTrident->BltScanDirection |= 1<<21; @@ -404,10 +408,12 @@ if ((pTrident->Chipset == PROVIDIA9682 || pTrident->Chipset == TGUI9680) && rop == GXcopy) pTrident->BltScanDirection |= FASTMODE; - if (pTrident->Chipset == PROVIDIA9685 && rop == GXcopy) + if ((pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) && rop == GXcopy) pTrident->BltScanDirection |= 1<<21; REPLICATE(fg); - if (pTrident->Chipset == PROVIDIA9685) { + if (pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) { TGUI_FPATCOL(fg); if (bg == -1) { pTrident->BltScanDirection |= 1<<12; @@ -463,7 +469,8 @@ TGUI_FMIX(XAAPatternROP[rop]); if ((pTrident->Chipset == PROVIDIA9682 || pTrident->Chipset == TGUI9680) && rop == GXcopy) drawflag = FASTMODE; - if (pTrident->Chipset == PROVIDIA9685) { + if (pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) { if (rop == GXcopy) drawflag |= 1<<21; TGUI_FPATCOL(color); } else { @@ -522,26 +529,30 @@ int drawflag = 0; REPLICATE(fg); - if (pTrident->Chipset == PROVIDIA9685) + if (pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) TGUI_FPATCOL(fg); else TGUI_FCOLOUR(fg); if (bg == -1) { drawflag |= 1<<12; - if (pTrident->Chipset == PROVIDIA9685) + if (pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) TGUI_BPATCOL(~fg); else TGUI_BCOLOUR(~fg); } else { REPLICATE(bg); - if (pTrident->Chipset == PROVIDIA9685) + if (pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) TGUI_BPATCOL(bg); else TGUI_BCOLOUR(bg); } - if (pTrident->Chipset == PROVIDIA9685) { + if (pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) { drawflag |= 7<<18; if (rop == GXcopy) drawflag |= 1<<21; } @@ -584,7 +595,8 @@ REPLICATE(transparency_color); if (transparency_color != -1) { - if (pTrident->Chipset == PROVIDIA9685) { + if (pTrident->Chipset == PROVIDIA9685 || + pTrident->Chipset == CYBER9388) { drawflag |= 1<<16; } else { TGUI_OPERMODE(pTrident->EngineOperation | DST_ENABLE); diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c Sat Dec 16 12:33:00 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c Sat Feb 10 09:37:50 2001 @@ -333,7 +333,6 @@ case CYBER9525DVD: case CYBER9397DVD: case CYBER9397: - case CYBER9388: case IMAGE975: case IMAGE985: if (pScrn->bitsPerPixel >= 8) @@ -344,9 +343,12 @@ pReg->tridentRegs3x4[PreEndFetch] = 0xFF; /* Fall Through */ case PROVIDIA9685: + case CYBER9388: + case CYBER9385: pReg->tridentRegs3x4[Enhancement0] = 0x40; /* Fall Through */ case PROVIDIA9682: + case CYBER9382: if (pTrident->UsePCIRetry) pReg->tridentRegs3x4[PCIRetry] = 0xDF; else diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c Fri Dec 8 04:05:16 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c Sat Feb 10 09:37:50 2001 @@ -418,6 +418,7 @@ "XAACreateInfoRec", "XAAHelpPatternROP", "XAAHelpSolidROP", + "XAAFillSolidRects", "XAACopyROP", "XAAPatternROP", "XAAInit", @@ -1635,9 +1636,9 @@ case CYBERBLADEI7: pTrident->ddc1Read = Tridentddc1Read; ramtype = "SDRAM"; - pTrident->IsCyber = TRUE; + /* pTrident->IsCyber = TRUE; VIA MVP4 integrated Desktop version */ Support24bpp = TRUE; - chipset = "CyberBlade/i7"; + chipset = "CyberBlade/i7/VIA MVP4"; pTrident->NewClockCode = TRUE; pTrident->frequency = NTSC; break; @@ -2579,13 +2580,10 @@ pScrn->fbOffset = 0; #ifdef XvExtension - if (pTrident->Chipset >= CYBER9397) + if ((pTrident->Chipset >= CYBER9397) && (!pTrident->NoAccel)) TRIDENTInitVideo(pScreen); #endif - if(pTrident->BlockHandler) - pScreen->BlockHandler = pTrident->BlockHandler; - pTrident->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = TRIDENTCloseScreen; pScreen->SaveScreen = TRIDENTSaveScreen; @@ -2744,6 +2742,9 @@ if (pTrident->DGAModes) xfree(pTrident->DGAModes); pScrn->vtSema = FALSE; + + if(pTrident->BlockHandler) + pScreen->BlockHandler = pTrident->BlockHandler; pScreen->CloseScreen = pTrident->CloseScreen; return (*pScreen->CloseScreen)(scrnIndex, pScreen); diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c Sat Dec 16 12:33:00 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c Sat Feb 10 09:37:50 2001 @@ -46,8 +46,7 @@ int freq, ffreq; int m, n, k; int p, q, r, s; - int startn, endn; - int endm, endk; + int endn, endm, endk, startk; p = q = r = s = 0; @@ -55,23 +54,25 @@ if (pTrident->NewClockCode) { - startn = 64; endn = 255; endm = 63; - endk = 3; + endk = 2; + if (clock >= 100000) startk = 0; + if (clock < 100000) startk = 1; + if (clock < 50000) startk = 2; } else { - startn = 0; endn = 121; endm = 31; endk = 1; + startk = 0; } freq = clock; - for (k=endk;k>=0;k--) - for (n=startn;n<=endn;n++) + for (k=startk;k<=endk;k++) + for (n=0;n<=endn;n++) for (m=1;m<=endm;m++) { ffreq = ( ( ((n + 8) * pTrident->frequency) / ((m + 2) * powerup[k]) ) * 1000); diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c Mon Jun 12 22:28:34 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c Fri Feb 9 21:33:14 2001 @@ -37,7 +37,7 @@ DriverRec V4L = { 40000, - "Xv driver for video4linux", + "v4l", V4LIdentify, /* Identify*/ V4LProbe, /* Probe */ V4LAvailableOptions, diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/etc/bindist/common/host.def xc/programs/Xserver/hw/xfree86/etc/bindist/common/host.def --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/etc/bindist/common/host.def Sat Dec 16 12:36:43 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/etc/bindist/common/host.def Tue Dec 19 13:13:36 2000 @@ -21,5 +21,6 @@ #define InstallHardcopyDocs YES #define HardcopyDocDirs RX XIE XKB XPRINT +#define InstallMiscManPages YES diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/parser/Monitor.c xc/programs/Xserver/hw/xfree86/parser/Monitor.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/parser/Monitor.c Tue Dec 5 14:06:53 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/parser/Monitor.c Fri Feb 9 21:33:15 2001 @@ -434,7 +434,7 @@ break; case DASH: if (xf86getToken (NULL) != NUMBER || - val.realnum < ptr->mon_hsync[ptr->mon_n_hsync].lo) + (float)val.realnum < ptr->mon_hsync[ptr->mon_n_hsync].lo) Error (HORIZSYNC_MSG, NULL); ptr->mon_hsync[ptr->mon_n_hsync].hi = val.realnum; break; @@ -468,7 +468,7 @@ break; case DASH: if (xf86getToken (NULL) != NUMBER || - val.realnum < ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo) + (float)val.realnum < ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo) Error (VERTREFRESH_MSG, NULL); ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = val.realnum; break; diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/xf86cfg/Imakefile xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile Sat Dec 16 12:33:00 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile Fri Feb 9 21:33:15 2001 @@ -96,7 +96,7 @@ #endif DEFINES = -DXF86CONFIG=\"XConfigFile\" $(MODULEDEFINES) \ - $(CURSESDEFINES) + $(CURSESDEFINES) -DPROJECT_ROOT=\"ProjectRoot\" #if HasDlopen DLLIB = DlLibrary diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad Thu Nov 30 15:55:16 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad Fri Feb 9 21:39:41 2001 @@ -1338,7 +1338,7 @@ Apply changes button there is no way to undo your changes. -*Expert.geometry: 800x600 +*Expert.geometry: 640x460 *Expert*vpane.min: 64 *Expert*vpane.max: 64 *Expert*vpane.showGrip: False @@ -1767,3 +1767,4 @@ *expert*tree*buffers.flagsL.fromVert: size *expert*tree*buffers.flags.fromVert: size *expert*tree*buffers.flags.fromHoriz: flagsL +*Expert*close.label: Close \ No newline at end of file diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/xf86cfg/accessx.c xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c Fri Oct 20 10:59:05 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c Fri Feb 9 21:39:41 2001 @@ -179,15 +179,12 @@ XtNstate, (xkb_info->xkb->ctrls->enabled_ctrls & (XkbAccessXKeysMask | XkbStickyKeysMask | - XkbMouseKeysMask | XkbMouseKeysAccelMask | - XkbRepeatKeysMask | XkbSlowKeysMask | - XkbBounceKeysMask)) != 0, NULL, 0); + XkbSlowKeysMask | XkbBounceKeysMask)) != 0, NULL, 0); apply = XtCreateManagedWidget("apply", commandWidgetClass, accessx, NULL, 0); XtAddCallback(apply, XtNcallback, ApplyCallback, NULL); form = XtCreateManagedWidget("Accessx", formWidgetClass, accessx, NULL, 0); - XtAddCallback(enable, XtNcallback, EnableCallback, (XtPointer)form); timeoutToggle = XtVaCreateManagedWidget("timeoutToggle", toggleWidgetClass, form, XtNstate, xkb_info->xkb->ctrls->ax_timeout > 60 @@ -450,7 +447,6 @@ XtSetArg(args[0], XtNstate, &state); XtGetValues(enable, args, 1); - EnableCallback(enable, (XtPointer)form, (XtPointer)(long)state); } void @@ -471,7 +467,7 @@ static void EnableCallback(Widget w, XtPointer user_data, XtPointer call_data) { - XtSetSensitive(user_data, (long)call_data); + XtSetSensitive((Widget)user_data, (long)call_data); } /*ARGSUSED*/ @@ -534,162 +530,148 @@ XtSetArg(args[0], XtNstate, &state); XtGetValues(enable, args, 1); if (state) { - xkb_info->xkb->ctrls->enabled_ctrls |= XkbAccessXKeysMask; xkb_info->config.initial_ctrls |= XkbAccessXKeysMask; + xkb_info->xkb->ctrls->enabled_ctrls |= XkbAccessXKeysMask; + } + else { + xkb_info->config.initial_ctrls &= ~XkbAccessXKeysMask; + xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbAccessXKeysMask; + } + + /* Timeout */ + XtSetArg(args[0], XtNstate, &state); + XtGetValues(timeoutToggle, args, 1); + if (state) + xkb_info->config.ax_timeout = + xkb_info->xkb->ctrls->ax_timeout = timeout->value * 60; + else + xkb_info->config.ax_timeout = + xkb_info->xkb->ctrls->ax_timeout = 65535; + + /* Enable StickyKeys */ + XtSetArg(args[0], XtNstate, &state); + XtGetValues(sticky, args, 1); + if (state) { + xkb_info->config.initial_ctrls |= XkbStickyKeysMask; + xkb_info->xkb->ctrls->enabled_ctrls |= XkbStickyKeysMask; + } + else { + xkb_info->config.initial_ctrls &= ~XkbStickyKeysMask; + xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbStickyKeysMask; + } + XtSetArg(args[0], XtNstate, &state); + XtGetValues(stickyAuto, args, 1); + if (state) { + xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask; + xkb_info->config.initial_opts &= ~XkbAX_LatchToLockMask; + xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask; + xkb_info->xkb->ctrls->ax_options &= ~XkbAX_LatchToLockMask; + } + else { + xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask; + xkb_info->config.initial_opts |= XkbAX_LatchToLockMask; + xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask; + xkb_info->xkb->ctrls->ax_options |= XkbAX_LatchToLockMask; + } + XtSetArg(args[0], XtNstate, &state); + XtGetValues(stickyBeep, args, 1); + if (state) { + xkb_info->config.initial_opts |= XkbAX_StickyKeysFBMask; + xkb_info->xkb->ctrls->ax_options |= XkbAX_StickyKeysFBMask; + } + else { + xkb_info->config.initial_opts &= ~XkbAX_StickyKeysFBMask; + xkb_info->xkb->ctrls->ax_options &= ~XkbAX_StickyKeysFBMask; + } + + /* Enable MouseKeys */ + XtSetArg(args[0], XtNstate, &state); + XtGetValues(mouse, args, 1); + if (state) { + xkb_info->config.initial_ctrls |= XkbMouseKeysAccelMask; + xkb_info->xkb->ctrls->enabled_ctrls |= XkbMouseKeysMask | + XkbMouseKeysAccelMask; + xkb_info->config.mk_delay = + xkb_info->xkb->ctrls->mk_delay = mouseDelay->value * 100; + xkb_info->config.mk_interval = + xkb_info->xkb->ctrls->mk_interval = 40; + xkb_info->config.mk_time_to_max = + xkb_info->xkb->ctrls->mk_time_to_max = + (mouseTime->value * 1000) / xkb_info->xkb->ctrls->mk_interval; + xkb_info->config.mk_max_speed = + xkb_info->xkb->ctrls->mk_max_speed = + mouseSpeed->value * mouseTime->value; + xkb_info->config.mk_curve = xkb_info->xkb->ctrls->mk_curve = 0; + } + else { + xkb_info->config.initial_ctrls &= ~(XkbMouseKeysMask | + XkbMouseKeysAccelMask); + xkb_info->xkb->ctrls->enabled_ctrls &= ~(XkbMouseKeysMask | + XkbMouseKeysAccelMask); + } + + /* Enable RepeatKeys */ + XtSetArg(args[0], XtNstate, &state); + XtGetValues(repeat, args, 1); + if (state) { + xkb_info->config.initial_ctrls |= XkbRepeatKeysMask; + xkb_info->xkb->ctrls->enabled_ctrls |= XkbRepeatKeysMask; + xkb_info->config.repeat_interval = + xkb_info->xkb->ctrls->repeat_interval = repeatRate->value * 1000; + xkb_info->config.repeat_delay = + xkb_info->xkb->ctrls->repeat_delay = repeatDelay->value * 1000; + } + else { + xkb_info->config.initial_ctrls &= ~XkbRepeatKeysMask; + xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbRepeatKeysMask; + } - /* Timeout */ - XtSetArg(args[0], XtNstate, &state); - XtGetValues(timeoutToggle, args, 1); - if (state) - xkb_info->config.ax_timeout = - xkb_info->xkb->ctrls->ax_timeout = timeout->value * 60; - else - xkb_info->config.ax_timeout = - xkb_info->xkb->ctrls->ax_timeout = 65535; - - /* Enable StickyKeys */ - XtSetArg(args[0], XtNstate, &state); - XtGetValues(sticky, args, 1); - if (state) { - xkb_info->config.initial_ctrls |= XkbStickyKeysMask; - xkb_info->xkb->ctrls->enabled_ctrls |= XkbStickyKeysMask; - } - else { - xkb_info->config.initial_ctrls &= ~XkbStickyKeysMask; - xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbStickyKeysMask; - } - XtSetArg(args[0], XtNstate, &state); - XtGetValues(stickyAuto, args, 1); - if (state) { - xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask; - xkb_info->config.initial_opts &= ~XkbAX_LatchToLockMask; - xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask; - xkb_info->xkb->ctrls->ax_options &= ~XkbAX_LatchToLockMask; - } - else { - xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask; - xkb_info->config.initial_opts |= XkbAX_LatchToLockMask; - xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask; - xkb_info->xkb->ctrls->ax_options |= XkbAX_LatchToLockMask; - } - XtSetArg(args[0], XtNstate, &state); - XtGetValues(stickyBeep, args, 1); - if (state) { - xkb_info->config.initial_opts |= XkbAX_StickyKeysFBMask; - xkb_info->xkb->ctrls->ax_options |= XkbAX_StickyKeysFBMask; - } - else { - xkb_info->config.initial_opts &= ~XkbAX_StickyKeysFBMask; - xkb_info->xkb->ctrls->ax_options &= ~XkbAX_StickyKeysFBMask; - } - - /* Enable MouseKeys */ - XtSetArg(args[0], XtNstate, &state); - XtGetValues(mouse, args, 1); - if (state) { - xkb_info->config.initial_ctrls |= XkbMouseKeysMask | - XkbMouseKeysAccelMask; - xkb_info->xkb->ctrls->enabled_ctrls |= XkbMouseKeysMask | - XkbMouseKeysAccelMask; - xkb_info->config.mk_delay = - xkb_info->xkb->ctrls->mk_delay = mouseDelay->value * 100; - xkb_info->config.mk_interval = - xkb_info->xkb->ctrls->mk_interval = 40; - xkb_info->config.mk_time_to_max = - xkb_info->xkb->ctrls->mk_time_to_max = - (mouseTime->value * 1000) / xkb_info->xkb->ctrls->mk_interval; - xkb_info->config.mk_max_speed = - xkb_info->xkb->ctrls->mk_max_speed = - mouseSpeed->value * mouseTime->value; - xkb_info->config.mk_curve = xkb_info->xkb->ctrls->mk_curve = 0; - } - else { - xkb_info->config.initial_ctrls &= ~(XkbMouseKeysMask | - XkbMouseKeysAccelMask); - xkb_info->xkb->ctrls->enabled_ctrls &= ~(XkbMouseKeysMask | - XkbMouseKeysAccelMask); - } - - /* Enable RepeatKeys */ - XtSetArg(args[0], XtNstate, &state); - XtGetValues(repeat, args, 1); - if (state) { - xkb_info->config.initial_ctrls |= XkbRepeatKeysMask; - xkb_info->xkb->ctrls->enabled_ctrls |= XkbRepeatKeysMask; - xkb_info->config.repeat_interval = - xkb_info->xkb->ctrls->repeat_interval = repeatRate->value * 1000; - xkb_info->config.repeat_delay = - xkb_info->xkb->ctrls->repeat_delay = repeatDelay->value * 1000; - } - else { - xkb_info->config.initial_ctrls &= ~XkbRepeatKeysMask; - xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbRepeatKeysMask; - } - - /* Enable SlowKeys */ - XtSetArg(args[0], XtNstate, &state); - XtGetValues(slowToggle, args, 1); - if (state) { - xkb_info->config.initial_ctrls |= XkbSlowKeysMask; - xkb_info->xkb->ctrls->enabled_ctrls |= XkbSlowKeysMask; - xkb_info->config.slow_keys_delay = - xkb_info->xkb->ctrls->slow_keys_delay = slow->value * 1000; - } - else { - xkb_info->config.initial_ctrls &= ~XkbSlowKeysMask; - xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbSlowKeysMask; - } - XtSetArg(args[0], XtNstate, &state); - XtGetValues(slowPressed, args, 1); - if (state) { - xkb_info->config.initial_opts |= XkbAX_SKPressFBMask; - xkb_info->xkb->ctrls->ax_options |= XkbAX_SKPressFBMask; - } - else { - xkb_info->config.initial_opts &= ~XkbAX_SKPressFBMask; - xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKPressFBMask; - } - XtSetArg(args[0], XtNstate, &state); - XtGetValues(slowAccepted, args, 1); - if (state) { - xkb_info->config.initial_opts |= XkbAX_SKAcceptFBMask; - xkb_info->xkb->ctrls->ax_options |= XkbAX_SKAcceptFBMask; - } - else { - xkb_info->config.initial_opts &= ~XkbAX_SKAcceptFBMask; - xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKAcceptFBMask; - } - - /* Enable BounceKeys */ - XtSetArg(args[0], XtNstate, &state); - XtGetValues(bounceToggle, args, 1); - if (state) { - xkb_info->config.initial_ctrls |= XkbBounceKeysMask; - xkb_info->xkb->ctrls->enabled_ctrls |= XkbBounceKeysMask; - xkb_info->config.debounce_delay = - xkb_info->xkb->ctrls->debounce_delay = bounce->value * 1000; - } - else { - xkb_info->config.initial_ctrls &= ~XkbBounceKeysMask; - xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbBounceKeysMask; - } - } - else { - xkb_info->config.initial_ctrls &= - ~(XkbAccessXKeysMask | XkbStickyKeysMask | XkbMouseKeysMask | - XkbMouseKeysAccelMask | XkbRepeatKeysMask | XkbSlowKeysMask | - XkbBounceKeysMask); - xkb_info->config.initial_opts &= - ~(XkbAX_TwoKeysMask | XkbAX_LatchToLockMask | XkbAX_StickyKeysFBMask | - XkbAX_SKPressFBMask | XkbAX_SKAcceptFBMask); - - xkb_info->xkb->ctrls->enabled_ctrls &= - ~(XkbAccessXKeysMask | XkbStickyKeysMask | XkbMouseKeysMask | - XkbMouseKeysAccelMask | XkbRepeatKeysMask | XkbSlowKeysMask | - XkbBounceKeysMask); - xkb_info->xkb->ctrls->ax_options &= - ~(XkbAX_TwoKeysMask | XkbAX_LatchToLockMask | XkbAX_StickyKeysFBMask | - XkbAX_SKPressFBMask | XkbAX_SKAcceptFBMask); + /* Enable SlowKeys */ + XtSetArg(args[0], XtNstate, &state); + XtGetValues(slowToggle, args, 1); + if (state) { + xkb_info->config.initial_ctrls |= XkbSlowKeysMask; + xkb_info->xkb->ctrls->enabled_ctrls |= XkbSlowKeysMask; + xkb_info->config.slow_keys_delay = + xkb_info->xkb->ctrls->slow_keys_delay = slow->value * 1000; + } + else { + xkb_info->config.initial_ctrls &= ~XkbSlowKeysMask; + xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbSlowKeysMask; + } + XtSetArg(args[0], XtNstate, &state); + XtGetValues(slowPressed, args, 1); + if (state) { + xkb_info->config.initial_opts |= XkbAX_SKPressFBMask; + xkb_info->xkb->ctrls->ax_options |= XkbAX_SKPressFBMask; + } + else { + xkb_info->config.initial_opts &= ~XkbAX_SKPressFBMask; + xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKPressFBMask; + } + XtSetArg(args[0], XtNstate, &state); + XtGetValues(slowAccepted, args, 1); + if (state) { + xkb_info->config.initial_opts |= XkbAX_SKAcceptFBMask; + xkb_info->xkb->ctrls->ax_options |= XkbAX_SKAcceptFBMask; + } + else { + xkb_info->config.initial_opts &= ~XkbAX_SKAcceptFBMask; + xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKAcceptFBMask; + } + + /* Enable BounceKeys */ + XtSetArg(args[0], XtNstate, &state); + XtGetValues(bounceToggle, args, 1); + if (state) { + xkb_info->config.initial_ctrls |= XkbBounceKeysMask; + xkb_info->xkb->ctrls->enabled_ctrls |= XkbBounceKeysMask; + xkb_info->config.debounce_delay = + xkb_info->xkb->ctrls->debounce_delay = bounce->value * 1000; + } + else { + xkb_info->config.initial_ctrls &= ~XkbBounceKeysMask; + xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbBounceKeysMask; } XkbSetControls(DPY, XkbAllControlsMask, xkb_info->xkb); diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/xf86cfg/expert.c xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c Sat Dec 2 10:31:02 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c Fri Feb 9 21:39:42 2001 @@ -4615,6 +4615,9 @@ XtNtreeParent, config, NULL, 0); node->next = NewNode(mainNode, flags, NULL, config, NULL); node = node->next; + if (XF86Config->conf_flags == NULL) + XF86Config->conf_flags = (XF86ConfFlagsPtr) + XtCalloc(1, sizeof(XF86ConfFlagsRec)); XtAddCallback(flags, XtNcallback, OptionsCallback, (XtPointer)&(XF86Config->conf_flags->flg_option_lst)); diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/xf86cfg/interface.c xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c Fri Dec 8 21:23:26 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c Fri Feb 9 21:39:42 2001 @@ -61,7 +61,11 @@ #include "stubs.h" #define randomize() srand((unsigned)time((time_t*)NULL)) +#ifdef PROJECT_ROOT +#define DefaultXFree86Dir PROJECT_ROOT +#else #define DefaultXFree86Dir "/usr/X11R6" +#endif /* * Prototypes diff -Naur -x CVS xc.orig/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c --- XFree86-4.0.2.orig/xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c Thu Nov 30 15:55:18 2000 +++ XFree86-4.0.2/xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c Fri Feb 9 21:39:42 2001 @@ -275,6 +275,7 @@ range[i].lo = range[i].hi = val; if (++i >= nrange || *str == '\0') break; + continue; } else if (*str != '-') return (0); diff -Naur -x CVS xc.orig/programs/Xserver/xkb/Imakefile xc/programs/Xserver/xkb/Imakefile --- XFree86-4.0.2.orig/xc/programs/Xserver/xkb/Imakefile Fri Oct 20 10:59:09 2000 +++ XFree86-4.0.2/xc/programs/Xserver/xkb/Imakefile Mon Jan 22 14:49:33 2001 @@ -67,6 +67,8 @@ LinkSourceFile(XKBAlloc.c,$(XLIBSRC)) LinkSourceFile(XKBGAlloc.c,$(XLIBSRC)) +#if UseConfDirForXkb LinkConfDirectory(xkb,.,xkb,.) +#endif DependTarget() diff -Naur -x CVS xc.orig/programs/Xserver/xkb/xkbActions.c xc/programs/Xserver/xkb/xkbActions.c --- XFree86-4.0.2.orig/xc/programs/Xserver/xkb/xkbActions.c Tue Apr 4 15:25:23 2000 +++ XFree86-4.0.2/xc/programs/Xserver/xkb/xkbActions.c Fri Feb 9 21:39:42 2001 @@ -1318,6 +1318,9 @@ } else CoreProcessPointerEvent(xE,dev,count); } + else if (keyEvent) + FixKeyState(xE,dev); + xkbi->prev_state= oldState; XkbComputeDerivedState(xkbi); keyc->prev_state= keyc->state; diff -Naur -x CVS xc.orig/programs/xedit/c-mode.c xc/programs/xedit/c-mode.c --- XFree86-4.0.2.orig/xc/programs/xedit/c-mode.c Mon Sep 27 02:30:08 1999 +++ XFree86-4.0.2/xc/programs/xedit/c-mode.c Fri Feb 9 21:39:43 2001 @@ -383,7 +383,7 @@ rtmp = MAX(rtmp, pright); } right = anchor->position + entity->offset; - while (entity && ++count < 3) { + while (entity && count++ < 3) { if (entity->property == Qerror) { right = anchor->position + entity->offset + entity->length; count = 0; diff -Naur -x CVS xc.orig/programs/xedit/ispell.c xc/programs/xedit/ispell.c --- XFree86-4.0.2.orig/xc/programs/xedit/ispell.c Tue Sep 26 11:57:24 2000 +++ XFree86-4.0.2/xc/programs/xedit/ispell.c Fri Feb 9 21:39:43 2001 @@ -339,14 +339,31 @@ static void IspellSetRepeated(Bool state) { + static char *mispelled, *repeated; + Arg args[1]; + + if (mispelled == NULL) { + XtSetArg(args[0], XtNlabel, &mispelled); + XtGetValues(ispell.mispelled, args, 1); + mispelled = XtNewString(mispelled); + } + if (repeated == NULL) { + XtSetArg(args[0], XtNlabel, &repeated); + XtGetValues(ispell.repeated, args, 1); + repeated = XtNewString(repeated); + } XtSetSensitive(ispell.replaceAll, !state); XtSetSensitive(ispell.ignoreAll, !state); XtSetSensitive(ispell.add, !state); XtSetSensitive(ispell.addUncap, !state); - if (state && XtIsManaged(ispell.mispelled)) - XtChangeManagedSet(&ispell.mispelled, 1, NULL, NULL, &ispell.repeated, 1); - else if (!state && XtIsManaged(ispell.repeated)) - XtChangeManagedSet(&ispell.repeated, 1, NULL, NULL, &ispell.mispelled, 1); + if (!state) { + XtSetArg(args[0], XtNlabel, mispelled); + XtSetValues(ispell.mispelled, args, 1); + } + else { + XtSetArg(args[0], XtNlabel, repeated); + XtSetValues(ispell.mispelled, args, 1); + } } static void diff -Naur -x CVS xc.orig/programs/xkbcomp/rules/xfree86.lst xc/programs/xkbcomp/rules/xfree86.lst --- XFree86-4.0.2.orig/xc/programs/xkbcomp/rules/xfree86.lst Wed Dec 6 15:18:08 2000 +++ XFree86-4.0.2/xc/programs/xkbcomp/rules/xfree86.lst Fri Feb 9 21:39:43 2001 @@ -38,6 +38,7 @@ ca Canadian cs Czechoslovakian dk Danish + dvorak Dvorak ee Estonian fi Finnish fr French @@ -64,7 +65,7 @@ es Spanish se Swedish th Thai - uk Ukrainian + ua Ukrainian gb United Kingdom vn Vietnamese nec/jp PC-98xx Series diff -Naur -x CVS xc.orig/programs/xload/Imakefile xc/programs/xload/Imakefile --- XFree86-4.0.2.orig/xc/programs/xload/Imakefile Tue Nov 14 13:20:39 2000 +++ XFree86-4.0.2/xc/programs/xload/Imakefile Mon Jan 22 14:49:35 2001 @@ -27,7 +27,7 @@ AllTarget(ProgramTargetName(xload)) NormalProgramTarget(xload,$(OBJS),$(DEPLIBS),$(LOCAL_LIBRARIES),NullParameter) -#if defined(OSF1Architecture) || defined(NetBSDArchitecture) || (defined(FreeBSDArchitecture) && OSMajorVersion > 1) || defined(OpenBSDArchitecture) +#if !InstallXloadSetGID InstallProgram(xload,$(BINDIR)) #else InstallProgramWithFlags(xload,$(BINDIR),$(INSTKMEMFLAGS)) diff -Naur -x CVS xc.orig/programs/xman/Imakefile xc/programs/xman/Imakefile --- XFree86-4.0.2.orig/xc/programs/xman/Imakefile Fri Feb 11 22:55:14 2000 +++ XFree86-4.0.2/xc/programs/xman/Imakefile Sat Jan 27 15:09:05 2001 @@ -11,10 +11,13 @@ #endif MANPATHS = $(SYSMANPATH) $(LOCALMANPATH) HELPFILE = -DHELPFILE=\"$(LIBDIR)$(PATHSEP)xman.help\" +#if HasMkstemp +MKSTEMP = -DHAS_MKSTEMP +#endif OSMAJORVERSION = OSMajorVersion OSMINORVERSION = OSMinorVersion - DEFINES = -DOSMAJORVERSION=$(OSMAJORVERSION) -DOSMINORVERSION=$(OSMINORVERSION) $(HELPFILE) $(MANPATHS) + DEFINES = -DOSMAJORVERSION=$(OSMAJORVERSION) -DOSMINORVERSION=$(OSMINORVERSION) $(HELPFILE) $(MANPATHS) $(MKSTEMP) DEPLIBS = XawClientDepLibs LOCAL_LIBRARIES = XawClientLibs SRCS = ScrollByL.c handler.c man.c buttons.c help.c \ diff -Naur -x CVS xc.orig/programs/xman/misc.c xc/programs/xman/misc.c --- XFree86-4.0.2.orig/xc/programs/xman/misc.c Tue Jun 13 19:15:53 2000 +++ XFree86-4.0.2/xc/programs/xman/misc.c Sat Jan 27 15:09:06 2001 @@ -45,8 +45,18 @@ #include static FILE * Uncompress(ManpageGlobals * man_globals, char * filename); -static Boolean UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output); -static Boolean UncompressUnformatted(ManpageGlobals * man_globals, char * entry, char * filename); +#ifndef HAS_MKSTEMP +static Boolean UncompressNamed(ManpageGlobals * man_globals, char * filename, + char * output); +static Boolean UncompressUnformatted(ManpageGlobals * man_globals, + char * entry, char * filename); +#else +static Boolean UncompressNamed(ManpageGlobals * man_globals, char * filename, + char * output, FILE ** output_fd); +static Boolean UncompressUnformatted(ManpageGlobals * man_globals, + char * entry, char * filename, + FILE **file); +#endif #if defined(ISC) || defined(SCO) static char *uncompress_format = NULL; @@ -279,14 +289,23 @@ char tmp_file[BUFSIZ], error_buf[BUFSIZ]; FILE * file; +#ifndef HAS_MKSTEMP if ( !UncompressNamed(man_globals, filename, tmp_file) ) return(NULL); else if ((file = fopen(tmp_file, "r")) == NULL) { - sprintf(error_buf, "Something went wrong in retrieving the %s", - "uncompressed manual page try cleaning up /tmp."); - PopupWarning(man_globals, error_buf); + sprintf(error_buf, "Something went wrong in retrieving the %s", + "uncompressed manual page try cleaning up /tmp."); + PopupWarning(man_globals, error_buf); } +#else + if (!UncompressNamed(man_globals, filename, tmp_file, &file)) { + sprintf(error_buf, "Something went wrong in retrieving the %s", + "uncompressed manual page try cleaning up /tmp."); + PopupWarning(man_globals, error_buf); + return(NULL); + } +#endif unlink(tmp_file); /* remove name in tree, it will remain until we close the fd, however. */ @@ -302,11 +321,20 @@ * Returns:; TRUE if the file was found. */ +#ifndef HAS_MKSTEMP static Boolean UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output) +#else +static Boolean +UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output, + FILE ** output_fd) +#endif { char tmp[BUFSIZ], cmdbuf[BUFSIZ], error_buf[BUFSIZ]; struct stat junk; +#ifdef HAS_MKSTEMP + int fd; +#endif if (stat(filename, &junk) != 0) { /* Check for existance of the file. */ if (errno != ENOENT) { @@ -323,7 +351,16 @@ */ strcpy(tmp, MANTEMP); /* get a temp file. */ +#ifndef HAS_MKSTEMP (void) mktemp(tmp); +#else + fd = mkstemp(tmp); + if (fd < 0) { + PopupWarning(man_globals, "Error creating a temp file"); + return FALSE; + } + *output_fd = fdopen(fd, "r"); +#endif strcpy(output, tmp); #ifdef GZIP_EXTENSION @@ -357,6 +394,9 @@ Format(ManpageGlobals * man_globals, char * entry) { FILE * file; +#ifdef HAS_MKSTEMP + int fd; +#endif Widget manpage = man_globals->manpagewidgets.manpage; char cmdbuf[BUFSIZ], tmp[BUFSIZ], filename[BUFSIZ], error_buf[BUFSIZ]; char path[BUFSIZ]; @@ -364,7 +404,11 @@ Position x,y; /* location to pop up the "would you like to save" widget. */ +#ifndef HAS_MKSTEMP if ( !UncompressUnformatted(man_globals, entry, filename) ) { +#else + if ( !UncompressUnformatted(man_globals, entry, filename, &file) ) { +#endif /* We Really could not find it, this should never happen, yea right. */ sprintf(error_buf, "Could not open manual page, %s", entry); PopupWarning(man_globals, error_buf); @@ -372,7 +416,11 @@ return(NULL); } +#ifndef HAS_MKSTEMP if ((file = fopen(filename, "r")) != NULL) { +#else + if (file != NULL) { +#endif char line[BUFSIZ]; if (fgets(line, sizeof(line), file) != NULL) { @@ -408,13 +456,23 @@ XFlush(XtDisplay(man_globals->standby)); strcpy(tmp,MANTEMP); /* Get a temp file. */ +#ifndef HAS_MKSTEMP (void) mktemp(tmp); +#else + fd = mkstemp(tmp); + file = fdopen(fd, "r"); +#endif strcpy(man_globals->tempfile, tmp); ParseEntry(entry, path, NULL, NULL); +#ifndef HAS_MKSTEMP sprintf(cmdbuf,"cd %s ; %s %s %s > %s %s", path, TBL, filename, FORMAT, man_globals->tempfile, "2> /dev/null"); +#else + sprintf(cmdbuf,"cd %s ; %s %s %s >> %s %s", path, TBL, + filename, FORMAT, man_globals->tempfile, "2> /dev/null"); +#endif if(system(cmdbuf) != 0) { /* execute search. */ sprintf(error_buf, @@ -423,12 +481,14 @@ file = NULL; } else { +#ifndef HAS_MKSTEMP if ((file = fopen(man_globals->tempfile,"r")) == NULL) { sprintf(error_buf, "Something went wrong in retrieving the %s", "temp file, try cleaning up /tmp"); PopupWarning(man_globals, error_buf); } else { +#endif XtPopdown( XtParent(man_globals->standby) ); @@ -460,7 +520,9 @@ else unlink(man_globals->tempfile); } +#ifndef HAS_MKSTEMP } +#endif } if (man_globals->compress || man_globals->gzip) /* If the original @@ -481,7 +543,13 @@ */ static Boolean -UncompressUnformatted(ManpageGlobals * man_globals, char * entry, char * filename) +#ifndef HAS_MKSTEMP +UncompressUnformatted(ManpageGlobals * man_globals, char * entry, + char * filename) +#else +UncompressUnformatted(ManpageGlobals * man_globals, char * entry, + char * filename, FILE **file) +#endif { char path[BUFSIZ], page[BUFSIZ], section[BUFSIZ], input[BUFSIZ]; int len_cat = strlen(CAT), len_man = strlen(MAN); @@ -505,7 +573,11 @@ * Then for compressed files in an uncompressed directory. */ sprintf(input, "%s.%s", filename, COMPRESSION_EXTENSION); +#ifndef HAS_MKSTEMP if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif man_globals->compress = TRUE; sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path, CAT, section + len_cat, page, COMPRESSION_EXTENSION); @@ -514,7 +586,11 @@ #ifdef GZIP_EXTENSION else { sprintf(input, "%s.%s", filename, GZIP_EXTENSION); +#ifndef HAS_MKSTEMP if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif man_globals->compress = TRUE; man_globals->gzip = TRUE; sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path, @@ -542,7 +618,11 @@ */ sprintf(input, "%s.%s", filename, COMPRESSION_EXTENSION); +#ifndef HAS_MKSTEMP if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif man_globals->compress = TRUE; sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path, CAT, section + len_cat, page, COMPRESSION_EXTENSION); @@ -551,7 +631,11 @@ #ifdef GZIP_EXTENSION else { sprintf(input, "%s.%s", filename, GZIP_EXTENSION); +#ifndef HAS_MKSTEMP if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif man_globals->compress = TRUE; man_globals->gzip = TRUE; sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path, @@ -566,7 +650,11 @@ sprintf(input, "%s/%s%s.%s/%s", path, MAN, section + len_man, COMPRESSION_EXTENSION, page); +#ifndef HAS_MKSTEMP if ( UncompressNamed(man_globals, input, filename) ) { +#else + if ( UncompressNamed(man_globals, input, filename, file) ) { +#endif man_globals->compress = TRUE; sprintf(man_globals->save_file, "%s/%s%s.%s/%s", path, CAT, section + len_cat, COMPRESSION_EXTENSION, page); diff -Naur -x CVS xc.orig/programs/xman/search.c xc/programs/xman/search.c --- XFree86-4.0.2.orig/xc/programs/xman/search.c Tue Jun 13 19:15:53 2000 +++ XFree86-4.0.2/xc/programs/xman/search.c Sat Jan 27 15:09:06 2001 @@ -149,11 +149,14 @@ FILE * DoSearch(ManpageGlobals * man_globals, int type) { - char cmdbuf[BUFSIZ],*mantmp; + char cmdbuf[BUFSIZ],*mantmp, *manpath; char tmp[BUFSIZ],path[BUFSIZ]; char string_buf[BUFSIZ], cmp_str[BUFSIZ], error_buf[BUFSIZ]; char * search_string = SearchString(man_globals); FILE * file; +#ifdef HAS_MKSTEMP + int fd; +#endif int count; Boolean flag; @@ -171,13 +174,37 @@ return(NULL); } - strcpy(tmp, MANTEMP); /* get a temp file. */ - (void) mktemp(tmp); - mantmp = tmp; - if (type == APROPOS) { char label[BUFSIZ]; + strcpy(tmp, MANTEMP); /* get a temp file. */ +#ifdef HAS_MKSTEMP + fd = mkstemp(tmp); + if (fd < 0) { + PopupWarning(man_globals, "Cant create temp file"); + return NULL; + } +#else + (void)mktemp(tmp); +#endif + mantmp = tmp; + + manpath=getenv("MANPATH"); + if (manpath == NULL || streq(manpath,"") ) { +#ifdef MANCONF + if (!ReadManConfig(path)) +#endif + { + strcpy(path,SYSMANPATH); +#ifdef LOCALMANPATH + strcat(path,":"); + strcat(path,LOCALMANPATH); +#endif + } + } else { + strcpy(path,manpath); + } + sprintf(label,"Results of apropos search on: %s", search_string); #ifdef NO_MANPATH_SUPPORT /* not quite correct, but the best I can do. */ @@ -191,7 +218,11 @@ PopupWarning(man_globals, error_buf); } +#ifdef HAS_MKSTEMP + if ((file = fdopen(fd, "r")) == NULL) +#else if((file = fopen(mantmp,"r")) == NULL) +#endif PrintError("lost temp file? out of temp space?"); /* diff -Naur -x CVS xc.orig/programs/xman/vendor.h xc/programs/xman/vendor.h --- XFree86-4.0.2.orig/xc/programs/xman/vendor.h Tue Aug 1 14:53:07 2000 +++ XFree86-4.0.2/xc/programs/xman/vendor.h Sat Jan 27 15:09:07 2001 @@ -135,10 +135,18 @@ # define NO_COMPRESS # else # define COMPRESSION_EXTENSION "Z" -# define UNCOMPRESS_FORMAT "zcat < %s > %s" +# ifndef HAS_MKSTEMP +# define UNCOMPRESS_FORMAT "zcat < %s > %s" +# else +# define UNCOMPRESS_FORMAT "zcat < %s >> %s" +# endif # define COMPRESS "compress" # define GZIP_EXTENSION "gz" -# define GUNZIP_FORMAT "gzip -c -d < %s > %s" +# ifndef HAS_MKSTEMP +# define GUNZIP_FORMAT "gzip -c -d < %s > %s" +# else +# define GUNZIP_FORMAT "gzip -c -d < %s >> %s" +# endif # define GZIP_COMPRESS "gzip" # endif /* ISC */ # endif /* UTEK */ @@ -154,10 +162,19 @@ # define NO_MANPATH_SUPPORT #endif -#ifdef NO_MANPATH_SUPPORT -# define APROPOS_FORMAT ("man -k %s | pr -h Apropos >> %s") +#ifndef HAS_MKSTEMP +# ifdef NO_MANPATH_SUPPORT +# define APROPOS_FORMAT ("man -k %s | pr -h Apropos > %s") +# else +# define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos > %s") +# endif #else -# define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos > %s") +/* with mkstemp the temp output file is already created */ +# ifdef NO_MANPATH_SUPPORT +# define APROPOS_FORMAT ("man -k %s | pr -h Apropos >> %s") +# else +# define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos >> %s") +# endif #endif #ifdef ultrix