I know the question is a bit vague. I'll try to explain better below:
My app (python/gtk) is mostly an indicator. Using this indicator you can choose to show/hide the main window.
When I try to open a new instance of the app I made it so it would check if the app is already running. If so, it would abort trying to run the app.
Now I want to adjust it, so before aborting I want it to bring the already active app's main window to the foreground. Even if this window isn't opened at the moment.
So I believe my question is: How can I get a (global?) variable/instance of my already active app from my new app? (so I can bring my main window to the foreground)
EDIT:
I just found this method in the api: GtkWindow - set_startup_id().
This says: Normally, startup identifier is managed automatically and you should only use this function in special cases like transferring focus from other processes.
So this means it should be possible to bring focus to a window from another process. But how would I get this id? And how would I use this id to bring it to the foreground?