diff options
author | lukefromdc <[email protected]> | 2023-06-19 18:03:18 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2023-07-17 02:47:28 +0200 |
commit | 6dd9ab19ab5a72c203dab7c2c96277f77e222260 (patch) | |
tree | 655c629bbf936cb5a63c5b840c35bc8f77649f6d /netspeed/src/netspeed.c | |
parent | ce52935ec89bacd417ca6065012986e83a920f48 (diff) | |
download | mate-applets-6dd9ab19ab5a72c203dab7c2c96277f77e222260.tar.bz2 mate-applets-6dd9ab19ab5a72c203dab7c2c96277f77e222260.tar.xz |
netspeed: port to in-process for wayland
*Also switch to automatic signal handling/disconnection
*Otherwise this applet when in-process will segfault on removal
Diffstat (limited to 'netspeed/src/netspeed.c')
-rw-r--r-- | netspeed/src/netspeed.c | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/netspeed/src/netspeed.c b/netspeed/src/netspeed.c index 60e2aec7..441f314f 100644 --- a/netspeed/src/netspeed.c +++ b/netspeed/src/netspeed.c @@ -1574,7 +1574,6 @@ netspeed_applet_factory (MatePanelApplet *applet, return FALSE; glibtop_init (); - g_set_application_name (_("MATE Netspeed")); netspeed = NETSPEED_APPLET (applet); netspeed->icon_theme = gtk_icon_theme_get_default (); @@ -1680,62 +1679,61 @@ netspeed_applet_factory (MatePanelApplet *applet, netspeed->timeout_id = g_timeout_add (REFRESH_TIME, (GSourceFunc)timeout_function, netspeed); - - g_signal_connect (applet, "change-size", + g_signal_connect_object (applet, "change-size", G_CALLBACK (applet_change_size_or_orient), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->icon_theme, "changed", + g_signal_connect_object (netspeed->icon_theme, "changed", G_CALLBACK (icon_theme_changed_cb), - netspeed); + netspeed, 0); - g_signal_connect (applet, "change-orient", + g_signal_connect_object (applet, "change-orient", G_CALLBACK (applet_change_size_or_orient), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->in_label, "size-allocate", + g_signal_connect_object (netspeed->in_label, "size-allocate", G_CALLBACK (label_size_allocate_cb), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->out_label, "size-allocate", + g_signal_connect_object (netspeed->out_label, "size-allocate", G_CALLBACK (label_size_allocate_cb), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->sum_label, "size-allocate", + g_signal_connect_object (netspeed->sum_label, "size-allocate", G_CALLBACK (label_size_allocate_cb), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->settings, "changed::auto-change-device", + g_signal_connect_object (netspeed->settings, "changed::auto-change-device", G_CALLBACK (auto_change_device_settings_changed), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->settings, "changed::device", + g_signal_connect_object (netspeed->settings, "changed::device", G_CALLBACK (device_settings_changed), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->settings, "changed::show-all-addresses", + g_signal_connect_object (netspeed->settings, "changed::show-all-addresses", G_CALLBACK (showalladdresses_settings_changed), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->settings, "changed::show-sum", + g_signal_connect_object (netspeed->settings, "changed::show-sum", G_CALLBACK (showsum_settings_changed), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->settings, "changed::show-bits", + g_signal_connect_object (netspeed->settings, "changed::show-bits", G_CALLBACK (showbits_settings_changed), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->settings, "changed::change-icon", + g_signal_connect_object (netspeed->settings, "changed::change-icon", G_CALLBACK (changeicon_settings_changed), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->settings, "changed::show-icon", + g_signal_connect_object (netspeed->settings, "changed::show-icon", G_CALLBACK (showicon_settings_changed), - netspeed); + netspeed, 0); - g_signal_connect (netspeed->settings, "changed::show-quality-icon", + g_signal_connect_object (netspeed->settings, "changed::show-quality-icon", G_CALLBACK (showqualityicon_settings_changed), - netspeed); + netspeed, 0); action_group = gtk_action_group_new ("Netspeed Applet Actions"); gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE); @@ -1761,7 +1759,7 @@ netspeed_applet_factory (MatePanelApplet *applet, return TRUE; } -MATE_PANEL_APPLET_OUT_PROCESS_FACTORY ("NetspeedAppletFactory", +MATE_PANEL_APPLET_IN_PROCESS_FACTORY ("NetspeedAppletFactory", NETSPEED_TYPE_APPLET, "NetspeedApplet", netspeed_applet_factory, |