[Gambas-user] "mutex" applications

Bruce bbruen at ...2308...
Wed Jun 6 11:18:50 CEST 2012


I have been mucking around with this for about a year now and haven't
found a solution.

We have a few gambas applications that are treated as pop-ups by the
users.  That is, they click on some type of launcher (be it a desktop
item, a menu item or in our case a wbar icon) and the application
starts.
Then they minimize it, or go to another desktop, or any other way to
hide the application window.
Then they relaunch it...

... and get another instance running.

However, sort of like things like Evolution, we only want to have one
copy of these applications running.  So we need some sort of "mutex"
checker that ensures that they can only run one instance of the
application.

So far, I have found that I can use gb.desktop to detect another
instance via the window title and just exit gracefully with a "Another
instance of xxxxxxxxxxx is running" message.

Blah!

That doesn't really do what I want.  What I want (what I really, really
want) is a way to activate the window found and then exit.

Any clues?

regards 
Bruce





More information about the User mailing list