gene@zeno.mn.org (Gene H. Olson) (08/13/90)
As has been discussed before in comp.sources.sun, and is very clear from the X11R4 documentation, X11 is supposed to run on top of SunView. This requires that SUN_WINDOWS be defined in $TOP/config/sun.cf. And it does work GREAT with SunOS 4.0.3. This feature makes it possible to run X on one frame buffer while you run SunView on another. You can switch between the screens with "adjacentscreens" easily, and I find it very helpful. However this feature is broken in SunOS 4.1. If you try to bring up X on top of Sunview it comes up, but hangs the keyboard. Research leads me to believe that Sun's documented (See 4.1 Release notes) changes to poll(2) somehow broke it. Hacker that I am, I recompiled it with -g and tried to debug it with "trace" and "dbx". To my great amazement, I found that attaching a debugger to the Xsun server fixed the problem! Since I really have no idea how the interface works, and since I couldn't reproduce the problem with the debugger, I reported the problem to Sun, and came up with "xkludge" shell script enclosed below. This workaround is an outrageous kludge. It simply starts up the X server, attaches to it with "trace", then kills the trace. Using this simple script the feature again works flawlessly, as it did under SunOS 4.0.3. I leave it to some informed Sun guru to explain why! #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: xkludge # Wrapped by gene@zeno on Mon Aug 13 00:52:33 1990 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f xkludge -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"xkludge\" else echo shar: Extracting \"xkludge\" \(231 characters\) sed "s/^X//" >xkludge <<'END_OF_xkludge' XPATH=.:/usr/local/bin:/usr/bin/X11:/usr/ucb:/usr/bin:/usr/etc:/usr/sccs:/usr/5bin Xexport PATH X/usr/bin/X11/xinit & Xsleep 15 XX=`ps -ax | sed -n -e 's/^ *\([0-9]*\) .* X :0$/\1/p'` Xtrace -p $X 2>/dev/null & XT=$! Xsleep 5 Xkill $T Xwait END_OF_xkludge if test 231 -ne `wc -c <xkludge`; then echo shar: \"xkludge\" unpacked with wrong size! fi chmod +x xkludge # end of overwriting check fi echo shar: End of shell archive. exit 0 _________________________________________________________________________ __ / ) Gene H. Olson uunet!digibd!zeno!gene / __ _ __ _ DigiBoard (__/ _(/_//_(/_ Minneapolis, MN (612) 922-8055