Issues with utility windows in Adobe AIR
July 15, 2008
In Adobe AIR there are three different window types available to create a new NativeWindow. One of the types is the NativeWindowType.UTILITY type:
The flash help says: »Utility windows use a slimmer version of the system chrome and do not appear on the Windows task bar and the Mac OS-X window menu.«
Some issues you should bear in mind when working with them are:
- On a multiple display setup: Utility windows don’t shift automatically when the screen with the open window is deactivated (normal windows do shift!). This is bad because you don’t have events in AIR that tell you when the screen size has changed. So the only way to fix the window position is checking the screen size when the window is activated again and then move it within the current screen bounds.
- Window.activate() sometimes doesn’t work when you call it in the handler method of a system icon click event (tray / dock). The workaround seems to be temporarily setting window.alwaysInFront to true before activation:
window.alwaysInFront = true; window.activate(); window.alwaysInFront = [yourOldAlwaysInFrontValue];
Not exactely sure if that is general os behaviour or a bug in AIR?
Filed under: Flex/AS3