EVT_APP_START vs EVT_APP_START_WINDOW | developer.brewmp.com EVT_APP_START vs EVT_APP_START_WINDOW | developer.brewmp.com




I have a legacy brew applet that I've updated to run under BrewMP. This applet normally gets launched in the background (ISHELL_StartBackgroundApplet hands me an EVT_APP_START_BACKGROUND) by a separate applet based on various conditions, but the user also the option of launching explicitly from an app menu icon.  I currently handle EVT_APP_START in this icon launch scenario, but that brings me to the foreground. Since my applet needs to be in the background (its configuration determines when and how to come to the foreground), it then does CloseApplet to move itself into the background.

The problem is that this foreground to background transition is accompanied by a white screen flash that looks bad. What I'd prefer to have happen is launch directly to background when user launches from the icon.

Ignoring philosopical ui questions about whether that's an appropriate thing to do, I see that if I handle EVT_APP_START_WINDOW instead of EVT_APP_START, my applet will launch directly to the background. So I (actually, someone I work with) tried a very quick test, and it seemed to produce the desired result. We start in the background, with no screen flash.


The question then is whether it's safe to make just that single change in my applet, or does handling EVT_APP_START_WINDOW mean my applet is declaring itself to be a 'Windowed Application' and so must change to support a different set of constraints? (e.g., with regard to event handling and memory management, as described in the 'Window Manager Technology Guide')