Re: [AD] ALLEGRO_FULLSCREEN_WINDOW flag

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


On Sun, 2010-01-24 at 11:25 -0500, Evert Glebbeek wrote:
> On 23 Jan 2010, at 17:22 , Elias Pschernig wrote:
> > The attached patch adds a new display flag called
> > ALLEGRO_FULLSCREEN_WINDOW which makes al_create_display ignore the
> > passed width and height and instead creates a fullscreen window as big
> > as the desktop. It's ignored under Windows and OSX for now.
> 
> It's not clear to me what it does exactly.
> Does it create a window that fills up the available screen space,
> meaning something that has a border, a title bar and leaves room for a
> taskbar/doc/whatever you call it? Or does it create a full-screen
> display that has the size of the desktop?
> In the latter case, why do we need a separate display flag for that?
> Can't you already query the desktop resolution and create a display
> with that resolution?
> Either way - I think the name is confusing.
> 

Yes, but I couldn't find a better name. Anyone has suggestions?

You can see what it does if you open firefox under linux. Press the F11
key and you get an instant-switch to fullscreen. Press F11 again and you
are back in windowed mode. It's a special resize-to-fullscreen (similar
but different to maximize).

The same works now in A5 programs (for now only with the internal
_al_xglx_toggle_fullscreen_windowed). I think we can unify the current
al_toggle_window_frame() and the upcoming maximize functionality so it's
just 3 flags you can dynamically set. So then the following flags would
be modifiable for an ALLEGRO_DISPLAY:

* ALLEGRO_NOFRAME (already exists)
* ALLEGRO_FULLSCREEN (already exists)
* ALLEGRO_FULLSCREEN_WINDOW (my patch adds it for X11, difference to
fullscreen is that not the video mode is changed to fit the window size,
but the window is resized to fit the current video mode)
* ALLEGRO_MAXIMIZED (same as ALLEGRO_FULLSCREEN_WINDOW except it toggles
maximized state instead of fullscreen state)

> > If someone figures out how to do things with Xinerama and XRandR (or can
> > fix XVidMode) this may not be needed any longer as al_get_monitor_info()
> > and al_set_current_video_adapter() should be able to achieve the same.
> 
> Hmm.
> So, is this actually a new feature, or is it something that works
> around problems with our full-screen X11 implementation? I get the
> impression it's the latter, in which case I think the proper solution
> is to fix said functions rather than add a feature that is not
> generally useful on other platforms.

Basically, what I meant is if Xinerama/XRandR stuff is all fixed, we
could probably add special cases to emulate ALLEGRO_FULLSCREEN_WINDOW.
It would be cumbersome though:

First, the information from al_get_monitor_info will have to be
reliable. Then to switch your window to fullscreen mode, you first
resize it to the desired size (which may be problematic because it won't
actually fit with title and borders, so maybe you have to disable the
frame as well first). Next, you set it to fullscreen - and now seeing
that the screen and window have the same size, we could add a special
case and instead of calling an XRandR function to change video modes we
call the function I added in the patch. Also the user would have to
remember the old position and size of the window and when switching back
from fullscreen restore it.

> > But even then the flag makes things much easier for the user as X11
> > decides on which monitor to place the window (here it is for example
> > always the monitor the bash window from which I run my game was on,
> > which is just perfect).
> 
> I'm not sure I understand. Wouldn't it be better in that case to add
> an option "don't care" to al_set_current_video_adapter() and let the
> window manager decide where the window goes (on OS X I don't think you
> actually get that option, but never mind that, we just pick a default
> ourselves in that case)?

I'm not too concerned with the monitor placement anyway. I was just
surprised that everything worked as it should when I tried it here and
without using any Xinerama/XRandR calls. (I've read about a lot of
problems with multi-monitor before so didn't expect A5 apps behaving so
perfect - even if it's not in real fullscreen but just this windowed
fullscreen.)

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>





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