diff options
Diffstat (limited to 'sway/commands/title_format.c')
-rw-r--r-- | sway/commands/title_format.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sway/commands/title_format.c b/sway/commands/title_format.c index 3d1c578c..c9ffe8fa 100644 --- a/sway/commands/title_format.c +++ b/sway/commands/title_format.c | |||
@@ -11,13 +11,12 @@ struct cmd_results *cmd_title_format(int argc, char **argv) { | |||
11 | if ((error = checkarg(argc, "title_format", EXPECTED_AT_LEAST, 1))) { | 11 | if ((error = checkarg(argc, "title_format", EXPECTED_AT_LEAST, 1))) { |
12 | return error; | 12 | return error; |
13 | } | 13 | } |
14 | struct sway_container *container = | 14 | struct sway_container *container = config->handler_context.container; |
15 | config->handler_context.current_container; | 15 | if (!container->view) { |
16 | if (container->type != C_VIEW) { | ||
17 | return cmd_results_new(CMD_INVALID, "title_format", | 16 | return cmd_results_new(CMD_INVALID, "title_format", |
18 | "Only views can have a title_format"); | 17 | "Only views can have a title_format"); |
19 | } | 18 | } |
20 | struct sway_view *view = container->sway_view; | 19 | struct sway_view *view = container->view; |
21 | char *format = join_args(argv, argc); | 20 | char *format = join_args(argv, argc); |
22 | if (view->title_format) { | 21 | if (view->title_format) { |
23 | free(view->title_format); | 22 | free(view->title_format); |