Dos Windows on 386i with X11R3

arran!rwu at rutgers.edu arran!rwu at rutgers.edu
Fri May 5 16:35:42 AEST 1989


I apologize for omitting some important details on how to make running X11
under overview work correctly. Hopefully, the following will provide the
necessary information. If not, please let me know. By the way, for the
386i, the Meta key mentioned below is really the left-diamond key (next to
the spacebar).

The following information is from Dana Chee (dana at bellcore.com):

Ron,
	You have to define SUN_WINDOWS
before compiling to get an Xsun which will run under overview.  The
Meta-L2 option to stop it is a patch I provided for Jim (and anyone
else who wanted it).  You can get it by looking in
/fs/X11/export/X11_R3_Src/updates/metakey.suntools.

[ I have appended the above mentioned file to this letter. Ron ]

Jim had two directories that used a different Imakefile.  in
.../ddx/sun, the Imakefile used SERVER_DEFINES (no SUN_WINDOWS), and
in .../ddx/sun_windows, the Imakefile used NEW_SERVER_DEFINES (has
SUN_WINDOWS).  I really don't think we need to make both, since having
it have the sun stuff compiled in isn't a problem.

Dana

--------------CUT HERE for metakey.suntools-------------------
Below are the changes:

			Dana Chee
			Bellcore
			MRE 2Q-250
			(201) 829-4488
			dana at bellcore.com

------------  report.metakey ----------------
VERSION:
	X11 release 2

CLIENT MACHINE:
	Sun 3/75

CLIENT OPERATING SYSTEM:
	SunOS 3.2

DISPLAY:
	Sun

SYNOPSIS:
	Add Meta-L2 support for running X under Sunview.

DESCRIPTION:
	These diff add the Meta-L2 support present in X10R4 which
        allowed an X server running under Sunview to return to
	Sunview by typing Meta-L2.  When the overview icon was
	clicked, the X server was restarted.

	Affected files:
		clients/xinit/xinit.c
		server/ddx/sun/sunInit.c
		server/ddx/sun/sunKbd.c

FIX:
*** clients/xinit/xinit.c.orig	Thu Feb 25 23:53:54 1988
--- clients/xinit/xinit.c	Thu Apr 21 14:29:11 1988
***************
*** 148,156 ****
  #endif /* SYSV */
  	if ((serverpid = startServer(server)) > 0
  	 && (clientpid = startClient(client)) > 0) {
! 		pid = -1;
! 		while (pid != clientpid && pid != serverpid)
! 			pid = wait(NULL);
  	}
  	signal(SIGQUIT, SIG_IGN);
  	signal(SIGINT, SIG_IGN);
--- 148,173 ----
  #endif /* SYSV */
  	if ((serverpid = startServer(server)) > 0
  	 && (clientpid = startClient(client)) > 0) {
! 		while( 1 )
! 		{
! 			union wait	status;
! 
! 			do
! 			{
! 				pid = wait3(&status, WUNTRACED, NULL);
! 			} while (pid != clientpid && pid != serverpid);
! 
! 			if (pid == serverpid &&
! 			    (WIFSTOPPED(status)))
! 			{
! 				kill (getpid(), SIGSTOP);
! 				kill (serverpid, SIGCONT);
! 			}
! 			else
! 			{
! 				break;
! 			}
! 		}
  	}
  	signal(SIGQUIT, SIG_IGN);
  	signal(SIGINT, SIG_IGN);
***************
*** 222,227 ****
--- 239,245 ----
  			break;
  	}
  	laststring = string;
+ 	fprintf(stderr, "\n");
  	return( pid != pidfound );
  }

*** server/ddx/sun/sunInit.c.orig	Sat Jan 16 12:40:55 1988
--- server/ddx/sun/sunInit.c	Thu Apr 21 14:20:51 1988
***************
*** 63,68 ****
--- 63,69 ----
  extern void SetInputCheck();
  extern char *strncpy();
  extern GCPtr CreateScratchGC();
+ extern WindowRec WindowTable[];

  #define	XDEVICE	"XDEVICE"
  #define	PARENT	"WINDOW_GFX"
***************
*** 704,706 ****
--- 705,773 ----

      return (fd);
  }
+ 
+ /*
+  * stopme - stop window for suntools
+  */
+ #ifdef	SUN_WINDOWS
+ stopme()
+ {
+ 	DevicePtr	pKbd;
+ 	int		i;
+ 
+ 	if( !sunUseSunWindows())
+ 		return;
+ 
+ 	/*
+ 	 * on our way out -- shut down keyboard and mouse
+ 	 * and remove the window
+ 	 */
+ 	pKbd = LookupKeyboardDevice();
+ 	sunKbdProc(pKbd,  DEVICE_OFF);
+ 	sunMouseProc(pKbd, DEVICE_OFF);
+ 	win_remove(windowFd);
+ 	kill(0, SIGSTOP);
+ 
+ 	/*
+ 	 * we're back, restore the window, and turn on the
+ 	 * keyboard and mouse
+ 	 */
+ 	win_insert(windowFd);
+ 	sunMouseProc(pKbd, DEVICE_ON);
+ 	sunKbdProc(pKbd, DEVICE_ON);
+ 
+ 	/*
+ 	 * refresh all screens
+ 	 */
+ 	for( i = 0; i < screenInfo.numScreens; i++ )
+ 	{
+ 		ExposeEveryone(&WindowTable[i], &screenInfo.screen[i]);
+ 		HandleExposures(&WindowTable[i]);
+ 	}
+ }
+ 
+ static
+ ExposeEveryone(pWin, pScreen)
+ WindowPtr     pWin;
+ ScreenPtr     pScreen;
+ {
+ 	WindowPtr	pChild;
+ 
+ 	pChild = pWin;
+ 	while( pChild )
+ 	{
+ 		if( pChild->mapped )
+ 		{
+ 			(* pScreen->RegionCopy)(pChild->exposed, pChild->clipList);
+ 			(* pScreen->RegionCopy)(pChild->borderExposed, pChild->borderClip);
+ 			ExposeEveryone(pChild->firstChild, pScreen);
+ 		}
+ 		pChild = pChild->nextSib;
+ 	}
+ }
+ #endif	SUN_WINDOWS
+ 
+ 
+ 	
+ 
+ 
*** server/ddx/sun/sunKbd.c.orig	Tue Feb  9 17:19:51 1988
--- server/ddx/sun/sunKbd.c	Thu Apr 21 14:23:58 1988
***************
*** 734,744 ****
--- 734,763 ----
      register struct inputevent *se;
  {   
      Firm_event	fe;
+     int		loc;
+     static	Meta_On, Meta_hold;

      fe.time = event_time(se);
      fe.id = event_id(se);
      fe.value = (event_is_up(se) ? VKEY_UP : VKEY_DOWN);

+     loc = (fe.id - 1) * sunKeySyms[sysKbPriv.type].mapWidth;
+ 
+     if( sunKeySyms[sysKbPriv.type].map[loc] == XK_Meta_L ||
+        sunKeySyms[sysKbPriv.type].map[loc] == XK_Meta_R ) /* Meta */
+     {
+ 	    Meta_hold = fe.id;
+ 	    Meta_On = (fe.value == VKEY_DOWN);
+     }
+     if( sunKeySyms[sysKbPriv.type].map[loc] == XK_L2 ) /* L2 */
+     {
+ 	    if( fe.value == VKEY_DOWN && Meta_On )
+ 	    {
+ 		    stopme();
+ 		    fe.id = Meta_hold;
+ 		    fe.value = VKEY_UP;
+ 	    }
+     }
      sunKbdProcessEvent (pKeyboard, &fe);
  }
  #endif SUN_WINDOWS



More information about the Comp.sys.sun mailing list