budgie-desktop-examples icon indicating copy to clipboard operation
budgie-desktop-examples copied to clipboard

Detect if an applet has been removed from the panel

Open fossfreedom opened this issue 7 years ago • 5 comments

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?

fossfreedom avatar Aug 13 '17 18:08 fossfreedom

Hm. Can I ask the use case?

ikeydoherty avatar Aug 13 '17 18:08 ikeydoherty

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.

fossfreedom avatar Aug 13 '17 18:08 fossfreedom

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?

ikeydoherty avatar Aug 13 '17 18:08 ikeydoherty

correct - applet looking after itself.

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

fossfreedom avatar Aug 13 '17 19:08 fossfreedom

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

yursan9 avatar Oct 20 '17 07:10 yursan9