[comp.windows.x] twm titles and Sequent ptys

donn@MILTON.U.WASHINGTON.EDU (Donn Cave) (01/07/90)

Please find enclosed, a patch to the R4 xterm source.  It addresses two
issues, icon name and pty allocation on Sequents.

>Is there a way to force the IconManager to use the title (as specified
>by -title) instead of the name of the program?  I have xterms
>running on different machines, and when they are iconified, I forget
>which one is which.
>--
>-Mac Pigman
>gwp@hss.caltech.edu	(internet)

If modifying the source code is acceptable, you could try the following
patch to the R4 xterm source.  If the icon is unnamed, it takes the value
of the title; the IconManager will then use that name.

The other change fixes a problem we had on our Sequent Symmetry, whose ptys
are named slightly different than the standard convention.  MIT xterms run
out of ptys fast, because they can't find all of them.  In this patch, ptys
are allocated using Sequent's ``getpseudotty'' routine.  If not compiled on
a Sequent, the pty patch has no effect.

		Donn Cave
		UCS
		University of Washington
		donn@milton.u.washington.edu
 
*** main.c.dist	Fri Jan  5 16:08:45 1990
--- main.c	Sat Jan  6 12:18:59 1990
***************
*** 140,145 ****
--- 140,149 ----
  #endif
  #endif
  
+ #ifdef sequent
+ #define HAS_GETPSEUDOTTY
+ #endif
+ 
  #include "ptyx.h"
  #include "data.h"
  #include "error.h"
***************
*** 794,804 ****
  
  	    XtSetValues (toplevel, args, 2);
  	}
  
  
  	if(inhibit & I_TEK)
  		screen->TekEmu = FALSE;
! 
  	if(screen->TekEmu && !TekInit())
  		exit(ERROR_INIT);
  
--- 798,820 ----
  
  	    XtSetValues (toplevel, args, 2);
  	}
+         if ((resource.title == 0) ^ (resource.icon_name == 0)) {
+             Arg args[2];
+             if (resource.title && !resource.icon_name)
+                 resource.icon_name = resource.title;
+             else if (resource.icon_name && !resource.title)
+                 resource.title = resource.icon_name;
+             XtSetArg (args[0], XtNtitle, resource.title);
+             XtSetArg (args[1], XtNiconName, resource.icon_name);
+ 
+             XtSetValues (toplevel, args, 2);
+         }
  
  
+ 
  	if(inhibit & I_TEK)
  		screen->TekEmu = FALSE;
!  
  	if(screen->TekEmu && !TekInit())
  		exit(ERROR_INIT);
  
***************
*** 901,906 ****
--- 917,930 ----
  get_pty (pty)
  int *pty;
  {
+ #ifdef HAS_GETPSEUDOTTY
+ 	if ((*pty = getpseudotty (&ttydev, &ptydev)) >= 0) {
+ 		return 0;
+ 	}
+ 	else {
+ 		return 1;
+ 	}
+ #else
  	static int devindex, letter = 0;
  
  #ifdef att
***************
*** 966,971 ****
--- 990,996 ----
  	return(1);
  #endif /* umips && SYSTYPE_SYSV */
  #endif /* att */
+ #endif /* doesn't have getpseudotty */
  }
  
  get_terminal ()