if (container->mode == MODE_STACK || container->mode == MODE_TABBED)
goto after_stackwin;
- /* When entering stacking mode, we need to open a window on which we can draw the
- title bars of the clients, it has height 1 because we don’t bother here with
- calculating the correct height - it will be adjusted when rendering anyways. */
- Rect rect = {container->x, container->y, container->width, 1};
+ /* When entering stacking mode, we need to open a window on
+ * which we can draw the title bars of the clients, it has
+ * height 1 because we don’t bother here with calculating the
+ * correct height - it will be adjusted when rendering anyways.
+ * Also, we need to use max(width, 1) because windows cannot
+ * be created with either width == 0 or height == 0. */
+ Rect rect = {container->x, container->y, max(container->width, 1), 1};
uint32_t mask = 0;
uint32_t values[2];
}
LOG("Getting clients for class \"%s\" / title \"%s\"\n", to_class, to_title);
- for (int workspace = 0; workspace < num_workspaces; workspace++) {
- if (workspaces[workspace].screen == NULL)
+ Workspace *ws;
+ TAILQ_FOREACH(ws, workspaces, workspaces) {
+ if (ws->screen == NULL)
continue;
Client *client;
- SLIST_FOREACH(client, &(workspaces[workspace].focus_stack), focus_clients) {
+ SLIST_FOREACH(client, &(ws->focus_stack), focus_clients) {
LOG("Checking client with class=%s, name=%s\n", client->window_class, client->name);
if (!client_matches_class_name(client, to_class, to_title, to_title_ucs, to_title_ucs_len))
continue;