DisplayScreen class>>hostWindowExtent: with HostWindowPlugin on X11 cannot possibly work (was: [squeak-dev] Re: The Trunk: Graphics-mt.332.mcz)

David T. Lewis lewis at mail.msen.com
Wed May 11 01:59:25 UTC 2016


On Mon, May 09, 2016 at 10:44:22AM -0700, tim Rowledge wrote:
> 
> > On 09-05-2016, at 3:16 AM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
> > 
> > The thing is that there's no HostWindowPlugin at all in http://www.mirandabanda.org/files/Cog/VM/latest/cogspur64linuxht-16.18.3692.tgz .
> 
> Dang, he???s right. There is no building of HostWindowPlugin in the linux build trees I???ve checked. Which must mean I???ve only ever set the size of the Scratch window on my iMac, which is seriously weirding me. I would *swear* (loudly) that we???ve been building with it included. Oh well, let???s try it out and see.
> 
> {later} damnitstupidmake
> {later} damnintstupidirritatingmake
> {time passes???}at last it???s in the buildlist
> {late}ooh it appears to build???
> {later} it produces the blank white screen Yoshiki mentioned. Bugger.
> 
> 
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> "Bother!" said Pooh, as Piglet pressed <START> on the Microwave...

Background: Marcel updated DisplayScreen methods to use HostWindowPlugin
to set the Squeak window size and window title. Meanwhile, Tim is trying
to get the plugin to compile for a Unix VM for Raspberry Pi.

But this cannot possibly work. The window index used by HostWindowPlugin
is supposed to be opaque value, known to the plugin but not to the image.
On a Windows platform, the window index might be 1. This is the value
that we currently have hard-coded in DisplayScreen class>>hostWindowIndex.
On a platform with X11 display, the host window index is an integer value
of type Window, which might be a value such as 16rA00001 (as tested on
my PC a few minutes ago:

     xwininfo: Window id: 0x3a00001 "squeak.image"

For a Unix VM, the HostWindowPlugin delegates to methods in
platforms/unix/vm-display-X11/sqUnixX11.c, which contains a check to make
sure that all window handles are are integer values greater than 16rFFFF
(so of course a value of 1 will fail). Presumably this is because the
designers of X11 wanted to ensure that their window handles would be values
that could not be easily confused with integers such as 0, 1, 2, 3, ... and
most likely Ian Piumarta was aware of this and added the check to fail the
primitive if the window handle was a value such as 1.

Therefore if Tim gets the HostWindowPlugin to compile, it is not going
to work anyway.

I suspect that we are missing something here with respect to the earlier
Qwaq code, which presumably did work. The missing thing seems to be a
way to obtain a handle for the Squeak display window. Possibly we could
use one additional HostWindowPlugin primitive to provide this information,
such that DisplayScreen class>>hostWindowIndex could call that primitive
rather than assuming a hard-coded value of 1.

I also would guess that Qwaq actually did the Right Thing, which would
be to let the image open its main display window by requesting it from
the VM (HostWindowPlugin in this case), and letting the plugin provide
the window handle as the result of that request. IMO that would be the
right way to do it for Squeak also, but for purposes of backward compatibility
in the near term, a HostWindowPlugin>>primitiveDefaultDisplayWindow would
be sufficient. On Windows, it would probably answer 1, and on X11 it would
answer the Window handle of the Squeak application window.

Dave



More information about the Squeak-dev mailing list