Re: [AD] good X citizens

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Peter Wang <tjaden@xxxxxxxxxx> writes:

> Why do Allegro X windows always pop up in the top-left most corner?
> Window placement should be left to the window manager.
> 
> I tried to find why this was by creating an Xlib program, following
> the steps taken by the X graphics driver, but couldn't emulate the
> behaviour (i.e. Michael, please fix this :-)

Allegro programs set USPosition hint to (0,0) coordinate, i.e. they
ask window manager to place window in the top-left corner.  Some
window managers may ignore these hints, some other may prefer user
defined hints from configuration file over program defined hints, some
other always ask user where to place new window.

If we don't set hints for window placement, then when create_screen
resizes window, part of window may appear outside of visible screen,
even if window size is smaller than visible screen size.

Alternatively, we can change window position with XMoveWindow if it
will be outside of visible screen after resizing, but this is more
destructive (for example, it will be hard or impossible to override
this behaviour in window manager' configuration file).

Or we can destroy and recreate window in create_screen, but it will be
slower then, and will blink more.

Also we can add some options to allegro.cfg, and set window placement
behaviour in X according to these options (move or don't move window
with XMoveWindow, preferred position(hint) for top-left corner, etc).

> 
> Also (and this applies to Windows, too), perhaps there ought to be a
> way to pass close window events onto the user program (e.g. setting
> a flag).  This would be the first step to making Allegro better for
> general applications (which require resizing, maximising, etc.)
> Unlike the other things, quitting is also important for games.

I don't know how to get close and resize window requests from window
manager in X.  I'll try to experiment with it.

-- 
Michael Bukin



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/