[comp.windows.x] CLX/Common Windows with Tektronix XP series X terminals, Allegro CL

hmueller@wfsc4.tamu.edu (Hal Mueller) (01/31/91)

Common Windows is a graphics package from Franz Inc. built on top of 
CLX.  I'm unable to start Common Windows with Tektronix XP27 or XP29 
terminals, and have traced the problem to CLX (a modified version
shipped by Franz).

The crash occurs in xlib:query-tree, in the lookup-window call in the line
      (setq parent (and (plusp parent) (lookup-window display parent)))

Error message is
Debug: ID 40 from display #<xlib:display wfsc2:0 (Tektronix, Inc. R1)> should have been a xlib:window, but was :WM_NORMAL_HINTS

ID 40 is the ID of the root window, and is always the ID reported.

I've reported this problem to both vendors, but haven't heard from them yet; 
can anyone shed any light?  Has anyone used the XP series Tektronix terminals
with Allegro Common Lisp?  Trace available on request.

The following code reproduces the bug:

(in-package 'user)

(defvar display)
(defvar screen)
(defvar root)
(defvar white)
(defvar window)
(defvar gcontext)

(defun start ()
  (setq display (xlib:open-display "wfsc2"))
  (setq screen (xlib:display-default-screen display))
  (setq root (xlib:screen-root screen))
  (setq white (xlib:screen-white-pixel screen))
  (setq window (xlib:create-window :parent root :x 300 :y 100
                :width 200 :height 200 :background white
                :border-width 2 :override-redirect :on))
  (xlib:map-window window)
  (xlib:display-finish-output display)
  (format t "We have just created a window and drawn it on the screen.~%")
  (format t "Now, type (xlib:query-tree window).~%")
  (format t "You should get NIL, the parent, and the root.~%")
  (format t "Try it.  Then say (stop) to destroy the window.~%~%"))

(defun stop ()
  (xlib:unmap-window window)
  (xlib:display-finish-output display))

(format t "Type (start)~%~%")

--
Hal Mueller               Remember that the only thing the USAF and USN have
hmueller@wfsc4.tamu.edu   ever agreed on is that the Army shouldn't have
n270ca@tamunix.Bitnet     fixed-wing aircraft.  --Mary Shafer

fr07+@andrew.cmu.edu (Frank Ritter) (02/05/91)

We (i.e. Garnet developers and me, a Garnet user) have seen this with
allegro on a pmax.  Franz thought it was because we were running an
outdated version of twm.  We traded mail, and things slid into
oblivion as it was hard to date our twm, and our patch worked.  It
occurs when allegro is running and writing to a pmax display, which I
assume you have somewhere in your loop.  This may not be the case, but
the fix may still work: where you would call query tree, just use the
default root window as the single member of a list.  In garnet it's
called *default-x-root*.  This is not what you always will want, but
my code works with it, and I'm happy.

Frank Ritter@cs.cmu.edu       best mail drop
      ritter@psy.cmu.edu      my real affiliation
        fr07@andrew.cmu.edu   where the above two point to