From 7bc52962ae85f8c01cda3ece9534f01e422b1d1e Mon Sep 17 00:00:00 2001 From: Egil Date: Thu, 25 Apr 2024 11:55:44 +0200 Subject: [PATCH] Initialize all fields --- glass-renderer/item.c | 10 +++++++--- glass-renderer/property.c | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/glass-renderer/item.c b/glass-renderer/item.c index 0eefbf9..fc58fb7 100644 --- a/glass-renderer/item.c +++ b/glass-renderer/item.c @@ -26,8 +26,12 @@ Bool init_items() { void item_constructor(Item *item) { item->window = None; + item->attr = NULL; + item->geom = NULL; item->is_mapped = False; item->_is_mapped = False; + item->x = 0; + item->y = 0; item->properties = NULL; item->prop_layer = NULL; item->prop_item_layer = NULL; @@ -36,11 +40,11 @@ void item_constructor(Item *item) { item->prop_coords = NULL; item->prop_coord_types = NULL; item->prop_draw_type = NULL; + item->damage = 0; + item->window_pixmap = None; + texture_initialize(&item->window_texture); item->draw_cycles_left = 0; item->parent_item = NULL; - item->attr = NULL; - item->geom = NULL; - texture_initialize(&item->window_texture); } void item_menu_update_space_pos_from_window(Item *item, int x, int y, int width, int height) { diff --git a/glass-renderer/property.c b/glass-renderer/property.c index 1401e28..1507dbf 100644 --- a/glass-renderer/property.c +++ b/glass-renderer/property.c @@ -11,6 +11,7 @@ Property *property_allocate(Properties *properties, Atom name) { prop->name = name; prop->name_str = XGetAtomName(display, prop->name); prop->type = None; + prop->format = 0; prop->values.bytes = NULL; for (size_t i = 0; i < PROGRAM_CACHE_SIZE; i++) { prop->programs[i].program = -1;