Before this patch, the window type would be checked even if
not actually requested to do so.
Fixes: #1852
*/
struct view *view_from_wlr_surface(struct wlr_surface *surface);
+/**
+ * view_query_create() - Create a new heap allocated view query with
+ * all members initialized to their default values (window_type = -1,
+ * NULL for strings)
+ */
+struct view_query *view_query_create(void);
+
/**
* view_query_free() - Free a given view query
* @query: Query to be freed.
action_arg_add_querylist(action, "query");
queries = action_get_querylist(action, "query");
}
- current_view_query = znew(*current_view_query);
+ current_view_query = view_query_create();
wl_list_append(queries, ¤t_view_query->link);
}
return NULL;
}
+struct view_query *
+view_query_create(void)
+{
+ struct view_query *query = znew(*query);
+ query->window_type = -1;
+ return query;
+}
+
void
view_query_free(struct view_query *query)
{