Jibran
Jibran

Reputation: 930

GTK+ Startup Notification Icon

In Gnome, whenever an application is started, the mouse cursor changes from normal to an activity indicator (a spinning wheel type thing on Ubuntu). Is there any way to inform Gnome (through some system call) when the application has finished launching so that the mouse cursor returns to normal without waiting for the usual timeout of 30 seconds to occur.

I have a program in Pythong using GTK+ that is showing the icon even after launching, so what system call do I make?

Upvotes: 7

Views: 951

Answers (4)

Marko
Marko

Reputation: 11

I had a similar issue with an application I wrote. I was launching the application through a shell script containing the line

python /path/to/application.py

This launched the application as I expected, but the startup notification did not stop. It worked correctly once I changed the content of my script to this:

exec "/usr/bin/python" "/path/to/application.py"

Obviously the latter one seems to be the correct way to launch the application, though I don't have enough insight to tell why.

Upvotes: 1

ephemient
ephemient

Reputation: 205024

Your application can opt out of startup notification by adding

StartupNotify=false

to your application's .desktop file.

Of course, it is friendlier to leave it enabled and participate in startup notification.

Upvotes: 2

u0b34a0f6ae
u0b34a0f6ae

Reputation: 49843

Normally it happens automatically when you open the application's window.

It may be that the application's launcher just calls an already running instance, in that case it won't be automatically detected. The call you need then is this:

import gtk
gtk.gdk.notify_startup_complete()

Upvotes: 5

Mez
Mez

Reputation: 24951

This normally happens automatically when calling the gtk.main() function

Upvotes: 0

Related Questions