FFI problem

Joshua Channing Gargus schwa at cc.gatech.edu
Fri Feb 23 13:19:11 UTC 2001


On Thu, Feb 22, 2001 at 05:24:20PM +0100, Bert Freudenberg wrote:
> On Wed, 21 Feb 2001, Joshua Channing Gargus wrote:
> 
> > What is the reasoning for having the 2 windows?
> 
> It simplifies going full-screen and nicely integrates with the browser
> plugin.
> 
> The problem is this: In X, the Window Manager is the boss. No application
> is allowed to just change its window size. The app issues a kind request
> "please resize me" and the WM can do it, but you can't be sure it does.
> This makes going full-screen somewhat hard. You can tell the WM to ignore
> some window, but then you won't get any decoration on it. So we use two
> windows - one to make the WM happy and inside of it the real window. When
> going full screen, the real Squeak window is "reparented" to the root
> window. It has the "leave-me-alone" flag set so the WM is scared and lets
> us do what we must (*). When reverting fromm full-screen mode, the Squeak
> window is reparented to the outer window with the window decoration.
> 
> Same story for the Browser Plugin. Mozilla provides a window for the
> plugin. We create the Squeak window as child of that window, so it looks
> like Squeak is running inside the browser. Of course, actually it's
> running completely on its own. That's why you can "escape" the browser
> window and go fullscreen from a plugin, too.

Ok. Thanks for the explanation.

> 
> A funny thing to try is to use "xwininfo" to get at the window id of, say,
> "xeyes" or "oclock", and then run Squeak inside that window:
> "squeak -browserWindow 0x3200018 bla.image" :)

Yes, that is fun :-)

> 
> Back on topic: the X11 FFI examples do work as expected in full-screen
> mode.

Actually, they didn't for me.  I suppose this could be a wm dependent thing.
If I run the examples in full-screen mode, I can use Alt-Tab (Windowmaker key 
binding) to cycle to the window that the example is being drawn on.  However,
as soon as I release Alt, it snaps back to displaying the Squeak child window.

So, let me get this straight... when I am running outside of a web browser 
and try the X11 examples, then the examples are drawn onto Squeak's parent
window, which is obscured by Squeak's child window.  When I hit 'full screen',
the child window is reparented to the root window, which the X11 examples
will draw onto (right??).  So, I would expect the examples to again be
obscured by the Squeak child window.  Am I missing something?

It appears that what we want to do is create the X11 GC on the child window
instead of the parent/root window.  How can we get a handle to the child 
window?  I thought of using XQueryTree to find the children of the parent
window, and to find the Squeak window within this list.  The first problem
is that if we are running full-screen, the root window may have children
other than the Squeak window.  We could get around this by naming the inner
window and looking for a window with this name.  The other problem is that
XQueryTree takes a Window** argument, and I couldn't figure out how to
express this to FFI (I am a complete novice).

Thanks again,
Joshua

> 
> -- Bert
> 
> (*) actually it's called "Override Redirect"





More information about the Squeak-dev mailing list