GTK Icon + Startup Notification

In Gnome, whenever the application starts, the mouse cursor changes from normal to an activity indicator (type of spinning wheel type on Ubuntu). Is there a way to tell Gnome (via some kind of system call) when the application finishes launching so that the mouse cursor returns to its normal state without waiting for a normal timeout of 30 seconds.

I have a program in Pythong using GTK + that shows an icon even after starting, so what kind of system call can I make?

+7
python linux ubuntu gnome
source share
4 answers

This usually happens automatically when you open the application window.

Perhaps the application starts only the running instance, in which case it will not be automatically detected. Then you need the following call:

import gtk gtk.gdk.notify_startup_complete() 
+5
source share

Your application may opt out of the launch notification by adding

 StartupNotify=false 

to your .desktop application.

Of course, it’s more convenient to leave it turned on and participate in the launch notification.

+2
source share

I had a similar problem with the application I wrote. I ran the application through a shell script containing a string

 python /path/to/application.py 

This started the application as I expected, but the launch notification did not stop. It worked correctly as soon as I changed the contents of my script to the following:

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

Obviously, the latter is apparently the right way to run the application, although I don't have enough information to understand why.

+1
source share

This usually happens when the gtk.main() function is gtk.main()

0
source share

All Articles