Repository navigation
controlCenter: notify rebuilt widgets of visibility when CC is open - #774
Open
AquilaAscension wants to merge 1 commit into
Open
AquilaAscension wants to merge 1 commit into
AquilaAscension wants to merge 1 commit into
Conversation
When the config is reloaded while the control center is visible, add_widgets() tears down and recreates every widget, but the new widgets never receive on_cc_visibility_change(true). As a result: - the volume and backlight sliders stay at 0 (their backend clients are only started by the visibility event) - buttons-grid toggle buttons never run their update-command, so they show their default state instead of the real one Reproduce on stock swaync: open the control center with a volume or backlight widget configured, then run 'swaync-client -R'. Both sliders drop to 0 until the panel is closed and reopened. Fix: after rebuilding the widget list, fire the visibility event when the control center is currently visible, mirroring set_visibility(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the config is reloaded (
swaync-client -R/ DBusReloadConfig) while the control center is open,add_widgets()tears down and recreates every widget, but the new widgets never receiveon_cc_visibility_change(true)— that event only fires inset_visibility().Consequences while the panel stays open:
PulseDaemon,BacklightUtil) are only started by the visibility event, so the sliders keep GTK's default valueupdate-commandis only run fromon_cc_visibility_changeReproduce
volumeorbacklightwidget and open the control centerswaync-client -RFix
After rebuilding the widget list in
add_widgets(), fire the visibility event if the control center is currently visible, mirroring whatset_visibility()does. Widgets rebuilt while hidden are unaffected (they still get the event on the next open).Tested on 0.12.6 with volume, backlight, and buttons-grid toggle widgets: after this change, an in-place
ReloadConfigkeeps slider values correct and re-syncs toggle states, with no need to close/reopen the panel.🤖 Generated with Claude Code