- // if the application is not started, the first time we start
- // it will by shown by default
- eventHandler.start(onsId, postmsg)
-
- // we just need to display
- eventHandler.showWindow(onsId, postmsg)
+ if (pid == -1) {
+ // if the application is not started, then the first time
+ // we start we also display it using the default policy engine
+ pid = eventHandler.start(onsId, postmsg)
+ } else {
+ // we just need to display it
+ eventHandler.showWindow(onsId, postmsg)
+ }