Skip to content

Commit 1672a9c

Browse files
committed
#164 render a brief change message to set as $WD_MESSAGE for the command
1 parent 874b7b4 commit 1672a9c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/layout.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ void apply(void) {
285285

286286
log_cap_lines_start(&log_cap_lines);
287287

288+
free(deltas_brief);
289+
288290
if ((head_changing_mode = slist_find_val(heads, head_current_mode_not_desired))) {
289291

290292
print_head(INFO, DELTA, head_changing_mode);
@@ -293,6 +295,11 @@ void apply(void) {
293295
head_changing_mode->zwlr_config_head = zwlr_output_configuration_v1_enable_head(zwlr_config, head_changing_mode->zwlr_head);
294296
zwlr_output_configuration_head_v1_set_mode(head_changing_mode->zwlr_config_head, head_changing_mode->desired.mode->zwlr_mode);
295297

298+
struct SList *heads = NULL;
299+
slist_append(&heads, head_changing_mode);
300+
deltas_brief = render_deltas_brief(displ->config_state, heads);
301+
slist_free(&heads);
302+
296303
} else if ((head_changing_adaptive_sync = slist_find_val(heads, head_current_adaptive_sync_not_desired))) {
297304

298305
print_head(INFO, DELTA, head_changing_adaptive_sync);
@@ -301,6 +308,10 @@ void apply(void) {
301308
head_changing_adaptive_sync->zwlr_config_head = zwlr_output_configuration_v1_enable_head(zwlr_config, head_changing_adaptive_sync->zwlr_head);
302309
zwlr_output_configuration_head_v1_set_adaptive_sync(head_changing_adaptive_sync->zwlr_config_head, head_changing_adaptive_sync->desired.adaptive_sync);
303310

311+
struct SList *heads = NULL;
312+
slist_append(&heads, head_changing_adaptive_sync);
313+
deltas_brief = render_deltas_brief(displ->config_state, heads);
314+
slist_free(&heads);
304315
} else {
305316

306317
print_heads(INFO, DELTA, heads);
@@ -318,6 +329,8 @@ void apply(void) {
318329
zwlr_output_configuration_v1_disable_head(zwlr_config, head->zwlr_head);
319330
}
320331
}
332+
333+
deltas_brief = render_deltas_brief(displ->config_state, heads_changing);
321334
}
322335

323336
// TODO unique file passed to the user
@@ -327,9 +340,6 @@ void apply(void) {
327340

328341
zwlr_output_configuration_v1_apply(zwlr_config);
329342

330-
free(deltas_brief);
331-
deltas_brief = render_deltas_brief(displ->config_state, heads_changing);
332-
333343
displ->config_state = OUTSTANDING;
334344

335345
slist_free(&heads_changing);

0 commit comments

Comments
 (0)