solus-project / budgie-desktop-examples

Examples on how to create trivial Budgie Desktop Applets
MIT License
19 stars 11 forks source link

Detect if an applet has been removed from the panel #7

Open fossfreedom opened 7 years ago

fossfreedom commented 7 years ago

Looking to create a test python applet which will invoke an action when the applet is removed from the panel.

Any thoughts how to-do this?

ikeydoherty commented 7 years ago

Hm. Can I ask the use case?

fossfreedom commented 7 years ago

sure.

Trying to find a method to remove a custom keybinding - when the applet is active its easy enough to add the keybinding via the applet init. If the applet is subsequently removed, that keybinding should be removed.

ikeydoherty commented 7 years ago

Oh so you're trying to do it during the lifecycle of the applet, not detect other applets? You could hook up the destroy signal and do like a GLib.message() to verify its being invoked?

fossfreedom commented 7 years ago

correct - applet looking after itself.

oddly it doesnt appear that destroy is being invoked on either the applet nor plugin objects.

yursan9 commented 7 years ago

I agree with @fossfreedom .Can you add method to detect if the applet is deleted from panel?