From: sinkwitz@ifi.unizh.ch (Rainer Sinkwitz)
Subject: Re: 4.0.4 -> 4.0.5  Xmailtool doesn't work anymore?!
Organization: University of Zurich, Department of Computer Science
Date: Fri, 20 Nov 92 13:49:41 GMT


In article <feil.721918346@retina>, feil@prl.philips.nl (Hans Feil) writes:
> However, I am (was) a heavy user of the Sun mailtool running on a Sun
> and displayed on my screen. It is a very easy to use mailtool
> and I don't want to miss it. Now the mailtool comes up but when
> I make a selection (clicking) somewhere in its window to let it open
> a window and display a email-message, it fails! Input focus remains
> in the mailtool window (black arrow) and nothing works anymore.
> Then I have to walk to another screen, login in the Sun and kill
> the application. After that, the x-window of the mailtool is removed
> from my screen and the red arrow is back again.
> 

You ran into the nasty IRIX 4.0.5 XView bug ::::: ;-<

You will probably have to specify -Wfsdb with every execution of mailtool.

If you have the XView sources at hand you might apply the recently posted
patch from Huw Lynch <lynchh@cs.curtin.edu.au> which I append below and 
put the resulting libraries into $OPENWINHOME/lib.

Here comes my recent posting ---------------------------------

For all of you still struggling...

Since some of you have been asking, here is how to circumvent the
XView-4.0.5 bug:

THE BUG:
   Any XView application run under the IRIX 4.0.5 Xsgi X11-server
   will lock the Server on first mouse click and no more release
   it until killed from somewhere else.
   
SOLUTIONS:
  a) Run the application with '-Wfsdb' on the command line. Alternatively
     you could use '-fullscreendebug'. 
     
  b) If you have the sources, add
  
         extern int fullscreendebug; 
     
     e.g. before main() and 
     
         fullscreendebug = 1;
         
     after the xv_init(...) call. This forces the program to set this
     flag in any case - also when run with non-xview-buggy servers. But
     it releases you of the danger of omitting -Wfsdb and locking your
     screen.
     
  c) ONLY, if the program uses the 'fullscreen' package, you might add
        
        Fullscreen.Debug: True
        
      in $HOME/.Xresources or specify this resource on the command
      line.  This flag currently disables grabs in both the 'window'
      and the 'fullscreen' package, but is only set from resources
      in the 'fullscreen' package.


From: lynchh@cs.curtin.edu.au (Huw Lynch)
Newsgroups: comp.sys.sgi
Subject: XView 3.0 Irix 4.0.5 & No-Locale Patch

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);


-- 
oooooo    oooo  Rainer Sinkwitz, Multimedia Lab         sinkwitz@ifi.unizh.ch
 $   $   $   "  University of Zurich, Switzerland        VOICE +41-1-257-4346
 $"$$    """"$  Inst.f.Informatik, Winterthurerstr. 190   FAX +41-1-363-00-35
o$o "$o  $ooo"  CH-8057-Z\"urich