Closed hasufell closed 8 years ago
@elboulangero any objections? Otherwise I'll merge this soon
OK for me, except that there's a warning now at startup:
(pnmixer:6993): GLib-GObject-CRITICAL **: g_signal_handler_block: assertion 'handler_id > 0' failed
(pnmixer:6993): GLib-GObject-CRITICAL **: g_signal_handler_block: assertion 'handler_id > 0' failed
(pnmixer:6993): GLib-GObject-CRITICAL **: g_signal_handler_unblock: assertion 'handler_id > 0' failed
(pnmixer:6993): GLib-GObject-CRITICAL **: g_signal_handler_unblock: assertion 'handler_id > 0' failed
It's because the tray icon is updated too early, because of apply_prefs()
in main()
. Just moving this call later in main solves it. Here's the patch:
diff --git a/src/main.c b/src/main.c
index 4ae4bb2..53a2a27 100644
--- a/src/main.c
+++ b/src/main.c
@@ -847,7 +847,6 @@ main(int argc, char *argv[])
add_filter();
tray_icon = create_tray_icon();
- apply_prefs(0);
g_signal_connect(G_OBJECT(tray_icon), "popup-menu",
G_CALLBACK(popup_callback), popup_menu);
@@ -862,6 +861,8 @@ main(int argc, char *argv[])
g_signal_connect(G_OBJECT(mute_check_popup_window),
"toggled", G_CALLBACK(on_mute_clicked), NULL);
+ apply_prefs(0);
+
gtk_main();
uninit_libnotify();
alsa_close();
This also removes get_mute_state() and substitutes it with a bit more atomic and bug-free versions.
Fixes #99