Quantcast
Channel: Adobe Community : All Content - AIR Development
Viewing all articles
Browse latest Browse all 2954

Enforce full screen mode

$
0
0

For my app I run the following at startup to show the window as fullscreen:

 

~~~

window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.FULL_SCREEN_INTERACTIVE;

~~~

 

And then for the activate and deactivate states I do:

 

~~~

window.nativeWindow.addEventListener(air.Event.ACTIVATE, function() {

 

    window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.FULL_SCREEN_INTERACTIVE;

 

    window.nativeWindow.visible = true;

 

});

 

window.nativeWindow.addEventListener(air.Event.DEACTIVATE, function() {

 

    window.nativeWindow.visible = false;

 

});

~~~

 

So the idea is that when the window is deactivated or minimized it will hide the window. And then reshow it on focus or maximize and make the window fullsceen again.

 

The problems are:

 

1.) The window never becomes visible again when I ALT-Tab or CMD-Tab to the window after leaving the window. It also doesn't change the visibility states when minimizing or maximizing the window but DOES fire the activate and deactive event. Wonder if this is because of the Mac OS X animation on minimize?

 

2.) If I comment out the visibility code to test the fullscreen code. The activate event seems to run as soon as I minimze the window so the window becomes fullscreen again...

 

Any ideas on how to fix these two issues? Is there an alternate to visible to hide or show the window? And why is the activate event being fired when I minimize the window?


Viewing all articles
Browse latest Browse all 2954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>