Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!rice!sun-spots-request From: gene@zeno.mn.org (Gene H. Olson) Newsgroups: comp.sys.sun Subject: xkludge - Make X11R4 run on top of SunOS 4.1 SunView Keywords: Source Message-ID: <1990Aug13.235421.25923@rice.edu> Date: 13 Aug 90 06:07:08 GMT Sender: sun-spots-request@rice.edu Organization: Sun-Spots Lines: 67 Approved: Sun-Spots@rice.edu Originator: spots@titan.rice.edu X-Sun-Spots-Digest: Volume 9, Issue 300, message 3 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 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