From: lynchh@cs.curtin.edu.au (Huw Lynch)
Subject: XView 3.0 Patch to stop Irix 4.0.5 server hanging
Keywords: Irix 4.0.5 XView 3.0 patch OsHasLocale
Organization: Curtin University of Technology
Date: Tue, 10 Nov 1992 14:47:38 GMT


SUBJECT : XView 3.0 patch file that :

	  1. stops XView 3.0 hanging Irix 4.0.5 servers for _all_ client
             architectures.

	  2. For architectures that do not have OsHasLocale defined as YES
             in XView.cf it reads the resource files XView and <xv_app_name>
	     from the system app-defaults file.

This is not a patch specifically for Irix machines, all architectures should
use it (especially those that are networked to Irix machines and those
that do not have OsHasLocale defined).

Action 1 is activated _only_ when the server identifies itself as a
	"Silicon Graphics" version 4 server. When the buggy server is
	detected the -Wfsdb option is forced (which fixes the problem).

Action 2 is automatically activated and configured when OsHasLocale is 
  	defined as NO in config/XView.cf. Naturally the <xv_app_name>
	resources are given priority over those in XView and both have
	lower priority than the command line and defaults loaded on the
	server.
	
Files affected :

	xview3/lib/libxview/server/server.c
	xview3/config/XView.tmpl

To apply this patch do the following...

cd <top of the XView 3.0 distribution>
patch -p -s < <this file>


This patch must be applied after the 2 official patches (Patch-01 & Patch-02).



By,

Huw Lynch
----------------------------------------------------------------------------
lynchh@pride.cs.curtin.edu.au
huw@gaius.curtin.edu.au


*** ./config/XView.tmpl.old	Mon Nov  9 17:17:21 1992
--- ./config/XView.tmpl	Fri Nov  6 15:40:19 1992
***************
*** 99,106 ****
--- 99,109 ----
                MKDIRHIER = BourneShell BinDir/mkdirhier
  #endif
  
+ /* HUW */
  #if OsHasLocale
           LOCALE_DEFINES = -DOS_HAS_LOCALE
+ #else
+          LOCALE_DEFINES = -DNO_LOCALE_APP_DIR=\"$(XAPPLOADDIR)\"
  #endif
  
  #if OsHasMmap



*** ./lib/libxview/server/server.c.old	Thu Oct 29 12:25:35 1992
--- ./lib/libxview/server/server.c	Mon Nov  9 13:29:31 1992
***************
*** 36,41 ****
--- 36,43 ----
  #include <X11/Xatom.h>
  #include <X11/Xresource.h>
  
+ #include <xview/fullscreen.h>	/* HUW: For Irix 4.0.5 patch */
+ 
  #define	LIB_LOCALE	"/lib/locale/"
  
  #ifdef _XV_DEBUG
***************
*** 307,312 ****
--- 309,337 ----
  	xv_default_display = (Display *)server->xdisplay;
  	first_server = TRUE;
      }
+ 
+     /* HUW 
+ 
+        SGI Irix 4.0.5 patch.
+ 	
+        This patch will avoid hanging Irix 4.0.5 servers and will not affect
+        any other kind of server.
+ 
+        Other special cases for other architectures could be chained on the
+        end of this if statement.
+ 
+     */
+ 
+      if (strcmp(ServerVendor(server->xdisplay),"Silicon Graphics") == 0) {
+ 
+         if (VendorRelease(server->xdisplay) == 4) {
+ 	   /* We have to set no grab mode to avoid hangs */
+ 	   fullscreendebug = 1;
+   	}
+ 
+      }
+ 
+ 
      /*
       * Now that a server connection has been established, initialize the
       * defaults database. Note - This assumes that server_init will be called
***************
*** 356,362 ****
       * Merge cmdline options into database
       * Note:
       * For the first server object created, this is actually
!      * done twice. Once in xv_parse_cmdline() (in xv_init) and
       * once here.
       *
       * xv_merge_cmdline() has to be called in xv_parse_cmdline()
--- 381,387 ----
       * Merge cmdline options into database
       * Note:
       * For the first server object created, this is actually
!      * done twice. Once in xv_parse_cmdline() (in xv_
       * once here.
       *
       * xv_merge_cmdline() has to be called in xv_parse_cmdline()
***************
*** 388,393 ****
--- 413,419 ----
      server->localedir = NULL;
  
  #ifdef OS_HAS_LOCALE
+ 
      if (_xv_use_locale) {
  	int	lc_ctype_read = FALSE;
  
***************
*** 628,634 ****
  	server->numeric = "C";
  	server->timeformat = "C";
      }
! #endif OS_HAS_LOCALE
      /*
       * End of Sundae buyback code replacement for 
       *    defaults_load_db(filename);
--- 654,715 ----
  	server->numeric = "C";
  	server->timeformat = "C";
      }
! /* #endif OS_HAS_LOCALE */
! #else
! 
! #ifdef NO_LOCALE_APP_DIR
! 
! 	/* HUW */
! 
! 	/* Our OS doesn't have a locale but we still want to load in the
!            Xview system defaults and the application defaults. This is patch 
! 	   loads in the files XView and the file in xv_app_name from the
! 	   system app-defaults directory if they exist.
! 
! 	   Defaults in xv_app_name override those of specified in the XView
! 	   file.
! 
!            Both are overridden by any loaded above (i.e. the command line and
! 	   defaults loaded on the server using xrdb).  
! 
!          */
! 
! 	 /* Only application specific stuff if there is an app name given */
!          if (xv_app_name) {
! 
! 	    /* Construct the file name */
!             strcpy(filename, NO_LOCALE_APP_DIR);
!             strcat(filename,"/");
!             strcat(filename, xv_app_name);
! 
! 	    /* Load the application defaults if there are some */
!             if (new_db = XrmGetFileDatabase(filename)) {
! 
!                XrmMergeDatabases(server->db,&new_db);
!                server->db = new_db;
!                defaults_rdb = server->db;
! 
!             }
! 
!          }
!  
!          /* Load the XView defaults */
!          strcpy(filename,NO_LOCALE_APP_DIR);
! 	 strcat(filename,"/XView");
! 
! 	 if (new_db = XrmGetFileDatabase(filename)) {
! 
! 		XrmMergeDatabases(server->db,&new_db);
! 		server->db = new_db;
! 		defaults_rdb = server->db;
! 
! 	 }
! 
! 
! #endif /* NO_LOCALE_APP_DIR */
! #endif /* not def OS_HAS_LOCALE */
! 
! 
      /*
       * End of Sundae buyback code replacement for 
       *    defaults_load_db(filename);
Newsgroups: comp.windows.open-look,comp.windows.x,comp.sys.sun.apps