Move initialization of view_query->link to ipc.c

This commit is contained in:
Consolatis 2026-04-15 23:47:03 +02:00 committed by Anirvan Banerjee
parent 784cf42e4c
commit 1d40640188
2 changed files with 3 additions and 1 deletions

View file

@ -989,6 +989,9 @@ parse_criteria(const char *cmd, struct view_query **query)
const char *p = cmd + 1; const char *p = cmd + 1;
*query = view_query_create(); *query = view_query_create();
/* Allow safe destruction of view query */
wl_list_init(&(*query)->link);
while (*p && *p != ']') { while (*p && *p != ']') {
while (*p == ' ') { while (*p == ' ') {
p++; p++;

View file

@ -81,7 +81,6 @@ struct view_query *
view_query_create(void) view_query_create(void)
{ {
struct view_query *query = znew(*query); struct view_query *query = znew(*query);
wl_list_init(&query->link);
/* Must be synced with view_matches_rule() in window-rules.c */ /* Must be synced with view_matches_rule() in window-rules.c */
query->window_type = LAB_WINDOW_TYPE_INVALID; query->window_type = LAB_WINDOW_TYPE_INVALID;
query->maximized = VIEW_AXIS_INVALID; query->maximized = VIEW_AXIS_INVALID;