*/
bool con_is_leaf(Con *con);
+/**
+ * Returns true when this con is a leaf node with a managed X11 window (e.g.,
+ * excluding dock containers)
+ */
+bool con_has_managed_window(Con *con);
+
/*
* Returns true if a container should be considered split.
*
return TAILQ_EMPTY(&(con->nodes_head));
}
+/*
+ * Returns true when this con is a leaf node with a managed X11 window (e.g.,
+ * excluding dock containers)
+ */
+bool con_has_managed_window(Con *con) {
+ return (con != NULL
+ && con->window != NULL
+ && con->window->id != XCB_WINDOW_NONE
+ && con_get_workspace(con) != NULL);
+}
+
/**
* Returns true if this node has regular or floating children.
*
* stack afterwards */
int cnt = 0;
CIRCLEQ_FOREACH_REVERSE(state, &state_head, state)
- if (state->con && state->con->window)
+ if (con_has_managed_window(state->con))
cnt++;
/* The bottom-to-top window stack of all windows which are managed by i3.
/* X11 correctly represents the stack if we push it from bottom to top */
CIRCLEQ_FOREACH_REVERSE(state, &state_head, state) {
- if (state->con && state->con->window)
+ if (con_has_managed_window(state->con))
memcpy(walk++, &(state->con->window->id), sizeof(xcb_window_t));
//DLOG("stack: 0x%08x\n", state->id);
/* reorder by initial mapping */
TAILQ_FOREACH(state, &initial_mapping_head, initial_mapping_order) {
- if (state->con && state->con->window)
+ if (con_has_managed_window(state->con))
*walk++ = state->con->window->id;
}
@clients = get_client_list;
is(@clients, 0, 'Removed unmapped client from list (0)');
+# Dock clients should not be included in this list
+
+my $dock_win = open_window({
+ window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
+ });
+
+@clients = get_client_list;
+is(@clients, 0, 'Dock clients are not included in the list');
+
done_testing;