Since we added callbacks for the activate signal of menu items, pulseaudio_set_default, pulseaudio_move_input_to_sink and pulseaudio_move_output_to_source were getting called without any user interaction whenever we invoked gtk_check_menu_item_set_active in response to events from pulseaudio.
This interferes with automatic switching of default sinks/sources in wireplumber (and maybe also pulseaudio):
Disconnect bluetooth headphones.
We're notified that the default sink changed to laptop built-in audio, and to reflect this in the menus, gtk_check_menu_item_set_active is invoked which triggers the activate signal callback. This results in an invocation of pulseaudio_set_default.
Connect bluetooth headphones again.
Nothing happens because we've called pulseaudio_set_default earlier and wireplumber now thinks the laptop built-in audio is the preferred device and doesn't auto-switch to BT headphones.
The fix is to block our activate callback when invoking gtk_check_menu_item_set_active.
Alt-click and right-click was only meant to mute a sink/source, not set it as default, but since we added callbacks for the activate signal of menu items, these clicks did both. Also, left-click would set the default sink/source twice—probably harmless, but fixed here as well.
A bunch of fixes for
activate
callbacks being invoked without user interaction and conflicting withclicked
callbacks since https://github.com/christophgysin/pasystray/pull/121:Fix spurious "[menu_info] item activated: input (null)"
These would happen when descending into playback streams submenus. The fix is to ignore activation for anything that isn't a
CHECK_MENU_ITEM
.(Also fixes related compile warning and debug logging.)
Improve logging in pulseaudio_action.c
Fix defaults being changed and streams moved without user interaction
Since we added callbacks for the activate signal of menu items,
pulseaudio_set_default
,pulseaudio_move_input_to_sink
andpulseaudio_move_output_to_source
were getting called without any user interaction whenever we invokedgtk_check_menu_item_set_active
in response to events from pulseaudio.This interferes with automatic switching of default sinks/sources in wireplumber (and maybe also pulseaudio):
Disconnect bluetooth headphones.
We're notified that the default sink changed to laptop built-in audio, and to reflect this in the menus,
gtk_check_menu_item_set_active
is invoked which triggers the activate signal callback. This results in an invocation ofpulseaudio_set_default
.Connect bluetooth headphones again.
Nothing happens because we've called
pulseaudio_set_default
earlier and wireplumber now thinks the laptop built-in audio is the preferred device and doesn't auto-switch to BT headphones.The fix is to block our activate callback when invoking
gtk_check_menu_item_set_active
.Fix alt-click/right-click setting defaults in addition to muting
Alt-click and right-click was only meant to mute a sink/source, not set it as default, but since we added callbacks for the activate signal of menu items, these clicks did both. Also, left-click would set the default sink/source twice—probably harmless, but fixed here as well.