Re: [AD] Real weird unix bug, help wanted

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


On Thu, 2006-03-02 at 15:31 +0100, Hans de Goede wrote:
> 
> Elias Pschernig wrote:
> > On Thu, 2006-03-02 at 12:21 +0100, Elias Pschernig wrote:
> > 
> >> I'll restart now X11 and see if it then disappears again..
> >>
> > 
> > Ok. I restarted now X11, then your program, and switched 10 times (I
> > wonder what people around me thought :P) - and it always worked.
> > 
> > Then I clicked the firefox icon, typed in the allegro home page address
> > and let it load. Then started your program again, first switch worked,
> > and 2nd and 3rd switch failed with the problem.
> > 
> > Well, anyway, I must think what this could mean..
> > 
> 
> Good to hear you're looking into this. I've been looking onto this too 
> and I believe its a windowmanager <-> allegro app interaction race, 
> after doing:
>        setattr.override_redirect = True;
>        XChangeWindowAttributes(_xwin.display, _xwin.window,
>                                CWOverrideRedirect, &setattr);
> 
> The WM should leave the window alone, but it might take some time for 
> the WM to get around to releasing the window, quoting from man XMoveWindow:
>         If the override-redirect flag of the window is False and some
>         other
>         client has selected SubstructureRedirectMask on the parent, the X
>         server generates a ConfigureRequest event, and no further
>         processing is performed.  Otherwise, the window is moved.

Ah. So, well, this would at least explain the behavior.. some other
window, e.g. FireFox, sets this "SubstructureRedirectMask", and so no
further processing is done (i.e. Allegro window is not moved..). But,
what is the point of this? Why can't there be a reliable, standard way
to switch a window into fullscreen :/

> I've also been reading the ICCMM (enough C and M's ?) docs but nothing 
> there.
> 
> I've had simular issues with xmame, it is possible though, SDL does it.
> 
> But for now I've written a patch (attached) which destroys the window 
> when switching to fullscreen and then recreates it, since a new unmapped 
> window is not touched by the WM untill mapped, this way we are sure the 
> window will never get touched as we set OverrideRedirect before mapping 
> the window, the WM will see this immediately and never touch the window.
> 
> This all assumes that some client <-> WM interaction (race) is at fault.
> 

I can confirm this seems to fix the problem. Do you think it's possible
to simply unmap the window though, instead of destroying it?

For 4.3, it would be nice to have a way to simply switch a window
between fullscreen/windowed, preserving things like an OpenGL context
attached to it. Also, with the resizeable windows we will have there,
this might be independent of a resolution change. So, sooner or later we
will need a better solution.

For now, I think the patch should be applied though, because it is an
improvement.

Of course, there's again the ABI issue with the changed struct - but
since the xwin struct already has variable members depending on
the ./confugure results, it shouldn't matter.

-- 
Elias Pschernig





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