*/
static bool move_current_window_in_container(xcb_connection_t *connection, Client *client,
direction_t direction) {
+ assert(client->container != NULL);
+
Client *other = (direction == D_UP ? CIRCLEQ_PREV(client, clients) :
CIRCLEQ_NEXT(client, clients));
*second = NULL;
enum { O_HORIZONTAL, O_VERTICAL } orientation = O_VERTICAL;
+ if (con == NULL) {
+ printf("dock. done.\n");
+ return 1;
+ }
+
printf("event->event_x = %d, client->rect.width = %d\n", event->event_x, client->rect.width);
if (!border_click) {
client = table_remove(byChild, e->window);
printf("UnmapNotify for 0x%08x (received from 0x%08x): ", e->window, e->event);
- if(client == NULL) {
+ if (client == NULL) {
printf("not a managed window. Ignoring.\n");
return 0;
}
-
- if (client->container->currently_focused == client)
- client->container->currently_focused = NULL;
- CIRCLEQ_REMOVE(&(client->container->clients), client, clients);
+ if (client->container != NULL) {
+ if (client->container->currently_focused == client)
+ client->container->currently_focused = NULL;
+ CIRCLEQ_REMOVE(&(client->container->clients), client, clients);
+ }
printf("child of 0x%08x.\n", client->frame);
xcb_reparent_window(c, client->child, root, 0, 0);
text_color,
border_color;
+ /* Clients without a container (docks) won’t get decorated */
+ if (client->container == NULL)
+ return;
+
if (client->container->currently_focused == client) {
background_color = get_colorpixel(conn, client->frame, "#285577");
text_color = get_colorpixel(conn, client->frame, "#ffffff");
int current_client = 0;
CIRCLEQ_FOREACH(client, &(container->clients), clients) {
- /* TODO: currently, clients are assigned to the current container.
- Therefore, we need to skip them here. Does anything harmful happen
- if clients *do not* have a container. Is this the more desired
- situation? Let’s find out… */
- if (client->dock)
- continue;
-
/* Check if we changed client->x or client->y by updating it…
* Note the bitwise OR instead of logical OR to force evaluation of both statements */
if (client->force_reconfigure |
uint32_t mask = 0;
uint32_t values[3];
- /* Insert into the currently active container */
- CIRCLEQ_INSERT_TAIL(&(CUR_CELL->clients), new, clients);
-
/* Update the data structures */
CUR_CELL->currently_focused = new;
new->container = CUR_CELL;
new->dock = true;
new->titlebar_position = TITLEBAR_OFF;
new->force_reconfigure = true;
- SLIST_INSERT_HEAD(&(new->container->workspace->dock_clients), new, dock_clients);
+ new->container = NULL;
+ SLIST_INSERT_HEAD(&(c_ws->dock_clients), new, dock_clients);
}
}
printf("the client wants to be %d pixels height\n", new->desired_height);
}
+ /* Insert into the currently active container, if it’s not a dock window */
+ if (!new->dock)
+ CIRCLEQ_INSERT_TAIL(&(CUR_CELL->clients), new, clients);
+
render_layout(conn);
}
#include <string.h>
#include <sys/wait.h>
#include <stdarg.h>
+#include <assert.h>
#include "i3.h"
#include "data.h"
*
*/
void set_focus(xcb_connection_t *conn, Client *client) {
+ /* The dock window cannot be focused */
+ /* TODO: does this play well with dzen2’s popup menus? or do we just need to set the input
+ focus but not update our internal structures? */
+ if (client->dock)
+ return;
+
/* TODO: check if the focus needs to be changed at all */
/* Store current_row/current_col */
c_ws->current_row = current_row;
*
*/
void toggle_fullscreen(xcb_connection_t *conn, Client *client) {
+ /* clients without a container (docks) cannot be focused */
+ assert(client->container != NULL);
+
Workspace *workspace = client->container->workspace;
workspace->fullscreen_client = (client->fullscreen ? NULL : client);