Re: [AD] X mode restoring.

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


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



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