getting fullscreen button on window
William Labbett

hi,

Does allegro provide a way to recieve a signal that the fullscreen button has been pressed or do we need to use platform specific code for that.

You know what I mean : the middle button on the top of the window.

using A5

Sorry if this has already been asked somewhere else.

Matthew Leverton

If the window is set to be resizable, then you'll get a ALLEGRO_EVENT_DISPLAY_RESIZE event.

What do you want to do when the window is maximized?

William Labbett

Thanks. Switch to fullsreen.

Matthew Leverton

Are you using ALLEGRO_FULLSCREEN_WINDOW flag? You can toggle that flag to easily switch back and forth.

But I'm not sure if Allegro automatically makes the maximize button switch to full screen with that flag set. It would be nice if it did.

Thomas Fjellstrom

That's not what it does though. The maximize button tells the window manager (even on windows) to make the window fill the available screen area that isn't taken up by any docks (start bar) or the window frame itself.

Matthew Leverton

The maximize button tells the window manager (even on windows)

Yeah but I've seen a few Windows applications that override the maximize button to go full screen. It would be nice if Allegro could do that on windows that were set with FULLSCREEN_WINDOW.

William Labbett

Are you using ALLEGRO_FULLSCREEN_WINDOW flag? You can toggle that flag to easily switch back and forth.

No. Does it mean al_create_display() has to be recalled ?

Matthew Leverton

No. Does it mean al_create_display() has to be recalled ?

I've not used it, but my understanding is that the switch is automatic. Just call al_toggle_display_flag() with the proper display and flag.

Thomas Fjellstrom

Yeah but I've seen a few Windows applications that override the maximize button to go full screen. It would be nice if Allegro could do that on windows that were set with FULLSCREEN_WINDOW.

I suppose it'd be nice to get a new event for the maximize button. But how many people would actually expect the maximize button to do anything other than maximize? I think its a bad design call.

No. Does it mean al_create_display() has to be recalled ?

use ALLEGRO_FULLSCREEN_WINDOW instead of ALLEGRO_FULLSCREEN and you can switch between fullscreen and windowed modes. Note though, it means you're stuck with what ever resolution the user has set at the time, so you'll have to handle all kinds of resolutions and sizes.

Trent Gamblin

No, you just call al_toggle_display_option(ALLEGRO_FULLSCREEN_WINDOW). And you don't have to have it set to use that. It either has to 1) start off as a windowed display or 2) start off in FULLSCREEN_WINDOW mode.

William Labbett

As easy as that ? Cool.

only thing - in order to call the toggle function I need a way to do :

if( middle resize button pressed )
{
   toggle();
}

Is there a specifc event for that button ?

Matthew Leverton

I suppose it'd be nice to get a new event for the maximize button. But how many people would actually expect the maximize button to do anything other than maximize? I think its a bad design call.

It's not for every situation, but I think given the use of FULLSCREEN_WINDOW, it make sense (particularly if the window is not resizable).

But being able to catch a MAXIMIZE event would be sufficient. (Acknowledge the resize, and then switch to full screen.) However, you may want to use maximize but not let the window be resizable. Not sure if Allegro supports that sort of thing or not.

Is there a specifc event for that button ?

No.

William Labbett

It would nice to be able to use the button for switching to fullscreen but then if it was used only for that then they'd be no way to set a maximum windowed mode.

Thomas Fjellstrom

No, you just call al_toggle_display_option(ALLEGRO_FULLSCREEN_WINDOW). And you don't have to have it set to use that. It either has to 1) start off as a windowed display or 2) start off in FULLSCREEN_WINDOW mode.

Of course, you're right.

William Labbett

As it stands then the only way to switch to a proper fullscreen mode is via some button of one's own making. Is that right ?

Thomas Fjellstrom

Or a key shortcut.

Trent Gamblin

Without some kind of hacks like checking the new screen size is the full screen (with decorations), I think that's right.

Thread #607204. Printed from Allegro.cc