Menu

#529 [lxpanel] Use changed signal instead of destroy

-
closed-accepted
lxpanel (21)
5
2016-10-24
2016-02-26
No

Destroy is not suitable for saving widget state, and does not work on GTK+ 3. Use changed signal instead.

1 Attachments

Discussion

  • Lonely Stranger

    Lonely Stranger - 2016-02-26

    Thank you for a suggestion. Unfortunately this change isn't suitable. Imagine you are prefer-to use-keyboard type and choose in that dialog using keys - each key press will call g_app_info_set_as_default_for_type() which involves not only reload hashes in lxpanel but also regenerating one or more files in the system (where your configuration is saved). That is an abusing thing for slow systems, it's why it was implemented to run only once. Therefore this GTK+3 issue requires another solution, and thank you for mentioning that "destroy" signal is marked "unsuitable" for GTK+3, it was not with GTK+2 (see https://developer.gnome.org/gtk2/stable/GtkObject.html#GtkObject-destroy). If you happen to find any other signal which is ran once before finalizing the widget then it would be pretty good to use it for gtk+3. May be "unrealize" should do, could you test if it is ran just once with GTK+3 even if you change tabs in the configuration dialog few times, please?

     
  • Balló György

    Balló György - 2016-02-26

    Ah, I understand. I tested the "unrealize" signal with GTK+3, and it works fine. It runs only once when I close the window. I attached an updated patch.

     
  • Lonely Stranger

    Lonely Stranger - 2016-10-24
    • status: open --> closed-accepted
     
  • Lonely Stranger

    Lonely Stranger - 2016-10-24

    Thank you very much, your patch is pushed into master GIT branch.

     

Log in to post a comment.