Re: [AD] X mode restoring.

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


On January 3, 2011, Elias Pschernig wrote:
> On Mon, Jan 3, 2011 at 3:08 AM, Thomas Fjellstrom <
> 
> tfjellstrom@xxxxxxxxxx> wrote:
> > I've noticed some odd code in xdpy_destroy_display, it seems to wait
> > until the
> > last full screen display is destroyed before restoring the original mode.
> > I can see how that might be useful if you create more than one full
> > screen display on the same monitor, but it can completely break multi
> > monitor set ups.
> > 
> > What exactly is that code for? And can I just remove it? I can't really
> > think
> > of a good way to handle that case as well as multi monitor.
> 
> If you mean the part I added recently, it's to make this work:
> 
> new_display = al_create_display(...);
> if (new_display) {
>     al_destroy_display(old_display);
> }
> 
> Basically, if the al_create_display succeeds, I destroy the previous
> fullscreen display (and it must not mess up the fullscreen display just
> created). If it failed, I keep the previous fullscreen display.

I would suggest not doing that imo ;) so full of wrong. just keep the same 
display object. if the mode change isn't working, lets get it fixed, rather 
than making bodges like that, that we have to support.

> I guess for multi-monitor, the check has to be updated to not restore the
> mode if there's another fullscreen *on the same monitor*. I guess it's just
> another if-clause which checks the monitor the display is on. (No idea
> which field in ALLEGRO_DISPLAY does tell that though.)

My new changes make it so display->adapter stores the allegro virtual adapter 
id. So I suppose that'd work, just compare the adapters, and ignore the mode 
restore if theres another display already open, but as I said above, this 
really shouldn't be an issue.

-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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