assert(to_container != NULL);
CIRCLEQ_REMOVE(&(container->clients), current_client, clients);
+ SLIST_REMOVE(&(container->workspace->focus_stack), current_client, Client, focus_clients);
+
CIRCLEQ_INSERT_TAIL(&(to_container->clients), current_client, clients);
+ SLIST_INSERT_HEAD(&(to_container->workspace->focus_stack), current_client, focus_clients);
printf("Moved.\n");
current_client->container = to_container;
return 0;
}
+ /* Free the client’s colorpixel cache */
+ struct Colorpixel *colorpixel;
+ while (!SLIST_EMPTY(&(client->colorpixels))) {
+ colorpixel = SLIST_FIRST(&(client->colorpixels));
+ SLIST_REMOVE_HEAD(&(client->colorpixels), colorpixels);
+ free(colorpixel->hex);
+ free(colorpixel);
+ }
+
+ if (client->name != NULL)
+ free(client->name);
+
if (client->container != NULL) {
Container *con = client->container;
if (client == NULL)
return 1;
+ if (client->name != NULL)
+ free(client->name);
+
client->name_len = xcb_get_property_value_length(prop);
- client->name = malloc(client->name_len);
+ client->name = smalloc(client->name_len);
strncpy(client->name, xcb_get_property_value(prop), client->name_len);
printf("rename to \"%.*s\".\n", client->name_len, client->name);
}
free(reply);
+ free(cookies);
}
int main(int argc, char *argv[], char *env[]) {
return;
}
- if (!xcb_xinerama_is_active_reply(conn, xcb_xinerama_is_active(conn), NULL)->state) {
+ xcb_xinerama_is_active_reply_t *reply;
+ reply = xcb_xinerama_is_active_reply(conn, xcb_xinerama_is_active(conn), NULL);
+
+ if (!reply->state) {
printf("Xinerama is not active (in your X-Server), disabling.\n");
+ free(reply);
disable_xinerama(conn);
return;
}
+ free(reply);
+
query_screens(conn, virtual_screens);
i3Screen *s;
}
/* Free the old list */
- TAILQ_FOREACH(screen, virtual_screens, screens) {
+ while (!TAILQ_EMPTY(virtual_screens)) {
+ screen = TAILQ_FIRST(virtual_screens);
TAILQ_REMOVE(virtual_screens, screen, screens);
free(screen);
}