Adobe AIR Non-Transparent Window Bugs Part 3: Native Controls Showing Up

February 9th, 2010 by Steven Sacks

In my previous post, I showed how sometimes Windows would draw native controls on top of your non-transparent windows, as pictured here:

Windows XP

However, I could not figure out a sure way to reproduce it. Now I have.

Here's how you do it:

1. Make a new AIR application in Flex Builder.

2. In your-app.xml, set systemChrome to none and visible to true.

3. Prevent MINIMIZE and MAXIMIZE in your WindowedApplication:

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
    <mx:Script>
        <![CDATA[
            private function init():void
            {
             nativeWindow.addEventListener(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING, onDisplayStateChanging);
            }
            private function onDisplayStateChanging(event:NativeWindowDisplayStateEvent):void
            {
                if (event.afterDisplayState == NativeWindowDisplayState.MINIMIZED || event.afterDisplayState == NativeWindowDisplayState.MAXIMIZED)
                {
                    event.preventDefault();
                }
            }
        ]]>
    </mx:Script>
</mx:WindowedApplication>

4. Launch the app.

5. Click twice on the taskbar button (should do nothing).

6. Right-click on the taskbar button. Windows native system controls appear.

This is just a reliable way to make it happen every time. You don't have to do this exact thing to make them show up, they show up on their own randomly. I hope this example makes it easy for the AIR team to debug this issue.

I've exported the sample project with the above code. Click here to download.

Posted in AIR, Adobe, Bugs

3 Responses

  1. James

    Interesting. I think I see the same thing happen on CS4 applications as well, whenever they seize up.

  2. Christian Cantrell

    Hi, Steven. Have you filed this bug so we can get it into the queue and take a look?

    http://adobe.com/go/wish

    Thanks,
    Christian

  3. Steven Sacks

    I posted it in Adobe Bugs:

    https://bugs.adobe.com/jira/browse/FP-3878

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

About Steven Sacks

I am a professional Flash developer with over 13 years of programming experience. I have consulted for high-profile agencies and companies in San Francisco, Los Angeles, Atlanta and New York, and developed numerous award-winning websites and rich internet applications for clients including Adobe, Fox Sports, FX Networks, Anheuser-Busch, GE, DirecTV, ESPN, The Weather Channel, Home Depot, and Coca-Cola.

I am the author of the open-source Gaia Framework for Adobe Flash, which dramatically reduces development time and makes developing Flash sites much easier.