diff --git a/sway/commands/bar.c b/sway/commands/bar.c index ecc73ee3a..3c4da184f 100644 --- a/sway/commands/bar.c +++ b/sway/commands/bar.c @@ -30,7 +30,7 @@ static const struct cmd_handler bar_handlers[] = { { "strip_workspace_numbers", bar_cmd_strip_workspace_numbers }, { "tray_bindcode", bar_cmd_tray_bindcode }, { "tray_bindsym", bar_cmd_tray_bindsym }, - { "tray_last", bar_cmd_tray_last }, + { "tray_last", bar_cmd_tray_last }, { "tray_output", bar_cmd_tray_output }, { "tray_padding", bar_cmd_tray_padding }, { "unbindcode", bar_cmd_unbindcode }, diff --git a/sway/config/bar.c b/sway/config/bar.c index 1332f08d5..971ddfb75 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c @@ -172,7 +172,7 @@ struct bar_config *default_bar_config(void) { #if HAVE_TRAY bar->tray_padding = 2; - bar->tray_last = true; + bar->tray_last = true; wl_list_init(&bar->tray_bindings); #endif diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 180ec0573..1d019b579 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -1469,7 +1469,7 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) { json_object_object_add(json, "tray_padding", json_object_new_int(bar->tray_padding)); - json_object_object_add(json, "tray_last", json_object_new_boolean(bar->tray_last)); + json_object_object_add(json, "tray_last", json_object_new_boolean(bar->tray_last)); #endif return json; } diff --git a/sway/meson.build b/sway/meson.build index 381c5f86c..bab460ce1 100644 --- a/sway/meson.build +++ b/sway/meson.build @@ -147,7 +147,7 @@ sway_sources = files( 'commands/bar/strip_workspace_name.c', 'commands/bar/swaybar_command.c', 'commands/bar/tray_bind.c', - 'commands/bar/tray_last.c', + 'commands/bar/tray_last.c', 'commands/bar/tray_output.c', 'commands/bar/tray_padding.c', 'commands/bar/workspace_buttons.c', diff --git a/sway/sway-bar.5.scd b/sway/sway-bar.5.scd index 2a6f3a68e..b4e66b916 100644 --- a/sway/sway-bar.5.scd +++ b/sway/sway-bar.5.scd @@ -169,7 +169,8 @@ ContextMenu|Activate|SecondaryActivate|ScrollDown|ScrollLeft|ScrollRight|ScrollU for button3). *tray_last* yes|no - Sets the tray icons to appear as the last element in the bar. If _no_, the tray will appear to the left of the status command. Default is _yes_. + Sets the tray icons to appear as the last element in the bar. If _no_, the + tray will appear to the left of the status command. Default is _yes_. *tray_padding* [px] Sets the pixel padding of the system tray. This padding will surround the diff --git a/swaybar/config.c b/swaybar/config.c index 81921a43d..ed79cc1e4 100644 --- a/swaybar/config.c +++ b/swaybar/config.c @@ -78,7 +78,7 @@ struct swaybar_config *init_config(void) { #if HAVE_TRAY config->tray_padding = 2; - config->tray_last = true; + config->tray_last = true; wl_list_init(&config->tray_bindings); #endif diff --git a/swaybar/ipc.c b/swaybar/ipc.c index e2d859540..fedb343fa 100644 --- a/swaybar/ipc.c +++ b/swaybar/ipc.c @@ -308,9 +308,9 @@ static bool ipc_parse_config( config->tray_padding = json_object_get_int(tray_padding); } - if ((json_object_object_get_ex(bar_config, "tray_last", &tray_last))) { - config->tray_last = json_object_get_boolean(tray_last); - } + if ((json_object_object_get_ex(bar_config, "tray_last", &tray_last))) { + config->tray_last = json_object_get_boolean(tray_last); + } struct tray_binding *tray_bind = NULL, *tmp_tray_bind = NULL; wl_list_for_each_safe(tray_bind, tmp_tray_bind, &config->tray_bindings, diff --git a/swaybar/render.c b/swaybar/render.c index 236ef3f89..3f4b1041d 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -675,14 +675,14 @@ static uint32_t render_to_cairo(struct render_context *ctx) { * utilize the available space. */ double x = output->width; - /* config->tray_last = false; */ + #if HAVE_TRAY if (bar->tray && config->tray_last) { uint32_t h = render_tray(cairo, output, &x); max_height = h > max_height ? h : max_height; } #endif - if (bar->status) { + if (bar->status) { uint32_t h = render_status_line(ctx, &x); max_height = h > max_height ? h : max_height; } @@ -692,6 +692,7 @@ static uint32_t render_to_cairo(struct render_context *ctx) { max_height = h > max_height ? h : max_height; } #endif + x = 0; if (config->workspace_buttons) { struct swaybar_workspace *ws;