Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipc: make bar <bar_id> mode|hidden_state behave as documented #6680

Merged
merged 1 commit into from
Nov 25, 2021

Conversation

alebastr
Copy link
Contributor

sway-bar(5) says:

For compatibility with i3, bar mode <mode> [<bar-id>] syntax is supported along with the sway only bar <bar-id> mode <mode> syntax.

while the actual behavior is that bar_cmd_mode ignores already selected config->current_bar and applies the change to all the configured bars.

Before:

00:00:15.799 [INFO] [sway/commands.c:257] Handling command 'bar bar-0 mode dock'
00:00:15.799 [DEBUG] [sway/commands/bar.c:66] Selecting bar: bar-0
00:00:15.799 [DEBUG] [sway/commands.c:428] Subcommand: mode dock
00:00:15.799 [DEBUG] [sway/commands/bar/mode.c:33] Setting mode: 'dock' for bar: bar-0
00:00:15.799 [DEBUG] [sway/commands/bar/mode.c:33] Setting mode: 'dock' for bar: bar-1
00:00:15.799 [DEBUG] [sway/ipc-server.c:347] Sending barconfig_update event

Note that the barconfig_update event is only sent to the config->current_bar (bar-0), even if we just updated mode for all the bars.

After:

00:00:22.724 [INFO] [sway/commands.c:257] Handling command 'bar bar-0 mode dock'
00:00:22.724 [DEBUG] [sway/commands/bar.c:66] Selecting bar: bar-0
00:00:22.724 [DEBUG] [sway/commands.c:428] Subcommand: mode dock
00:00:22.724 [DEBUG] [sway/commands/bar/mode.c:33] Setting mode: 'dock' for bar: bar-0
00:00:22.724 [DEBUG] [sway/ipc-server.c:347] Sending barconfig_update event

sway-bar(5) says:

> For compatibility with i3, bar mode <mode> [<bar-id>] syntax is
> supported along with the sway only bar <bar-id> mode <mode> syntax.

while the actual behavior is that `bar_cmd_mode` ignores already
selected `config->current_bar` and applies the change to all the
configured bars.
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@emersion emersion enabled auto-merge (rebase) November 25, 2021 10:30
@emersion emersion merged commit 94dc486 into swaywm:master Nov 25, 2021
@alebastr alebastr deleted the bar-mode-syntax branch November 25, 2021 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants