Re: [AD] good X citizens

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


Michael Bukin <M.A.Bukin@xxxxxxxxxx> wrote:
> 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.
> 
> Allegro programs set USPosition hint to (0,0) coordinate, i.e. they
> ask window manager to place window in the top-left corner.  
...
> 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.

Ah, I see.

> 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).

Moving windows without asking the user seems wrong to me, at least
under most conventional window managers.

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

Some programs take this option, and it is quite annoying.

> 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).

Perhaps, but there are a lot of options already. :-(

How about we unmap the window in create_screen before resizing, then
remap it after?  Is there a standard behaviour among window
managers?  In a little test of mine (non-Allegro), on my particular
setup, it feels faster than destroy + recreate, and the window still
gets re-placed into a sane position.

It will be blinky though, as every program using a resolution other
than 320x200 window needs to resize + re-place, and people using
manual placement will need to place twice.  Maybe it would work
better if we created the window in the system driver init, but
didn't map it until create_screen.

PS. Sorry about the lateness.

-- 
FLOTION (FLO shun), n.  The tendency when sharing a waterbed to undulate
for five minutes every time the other person moves.
	-- Rich Hall, "Sniglets"



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