Some of them are useless nowadays, others very unlikely to be a problem.
Those which might still be interesting somewhen in the future are just
commented out.
*
*/
void run_assignments(i3Window *window) {
- DLOG("Checking assignments...\n");
+ DLOG("Checking if any assignments matches this window\n");
/* Check if any assignments match */
Assignment *current;
con->urgent = false;
workspace_update_urgent_flag(con_get_workspace(con));
}
- DLOG("con_focus done = %p\n", con);
}
/*
Con *con_for_window(Con *con, i3Window *window, Match **store_match) {
Con *child;
Match *match;
- DLOG("searching con for window %p starting at con %p\n", window, con);
- DLOG("class == %s\n", window->class_class);
+ //DLOG("searching con for window %p starting at con %p\n", window, con);
+ //DLOG("class == %s\n", window->class_class);
TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
TAILQ_FOREACH(match, &(child->swallow_head), matches) {
*
*/
void ewmh_update_client_list_stacking(xcb_window_t *stack, int num_windows) {
- DLOG("Updating _NET_CLIENT_LIST_STACKING\n");
xcb_change_property(
conn,
XCB_PROP_MODE_REPLACE,
xcb_flush(conn);
free(reply);
} else {
- ELOG("unhandled clientmessage\n");
+ DLOG("unhandled clientmessage\n");
return;
}
}
}
if (handler == NULL) {
- DLOG("Unhandled property notify for atom %d (0x%08x)\n", atom, atom);
+ //DLOG("Unhandled property notify for atom %d (0x%08x)\n", atom, atom);
return;
}
handle_focus_in((xcb_focus_in_event_t*)event);
break;
- case XCB_PROPERTY_NOTIFY:
- DLOG("Property notify\n");
+ case XCB_PROPERTY_NOTIFY: {
xcb_property_notify_event_t *e = (xcb_property_notify_event_t*)event;
last_timestamp = e->time;
property_notify(e->state, e->window, e->atom);
break;
+ }
default:
- DLOG("Unhandled event of type %d\n", type);
+ //DLOG("Unhandled event of type %d\n", type);
break;
}
}
xcb_get_geometry_reply_t *geom;
xcb_get_window_attributes_reply_t *attr = NULL;
- DLOG("---> looking at window 0x%08x\n", window);
-
xcb_get_property_cookie_t wm_type_cookie, strut_cookie, state_cookie,
utf8_title_cookie, title_cookie,
class_cookie, leader_cookie, transient_cookie,
}
if (needs_to_be_mapped && attr->map_state != XCB_MAP_STATE_VIEWABLE) {
- DLOG("map_state unviewable\n");
FREE_GEOMETRY();
goto out;
}
/* Don’t manage clients with the override_redirect flag */
- DLOG("override_redirect is %d\n", attr->override_redirect);
if (attr->override_redirect) {
FREE_GEOMETRY();
goto out;
startup_id_cookie = GET_PROPERTY(A__NET_STARTUP_ID, 512);
/* TODO: also get wm_normal_hints here. implement after we got rid of xcb-event */
- DLOG("reparenting!\n");
+ DLOG("Managing window 0x%08x\n", window);
i3Window *cwindow = scalloc(sizeof(i3Window));
cwindow->id = window;
*
*/
bool match_matches_window(Match *match, i3Window *window) {
- LOG("checking window %d (%s)\n", window->id, window->class_class);
+ LOG("Checking window 0x%08x (class %s)\n", window->id, window->class_class);
if (match->class != NULL) {
if (window->class_class != NULL &&
regex_matches(match->class, window->class_class)) {
LOG("window class matches (%s)\n", window->class_class);
} else {
- LOG("window class does not match\n");
return false;
}
}
regex_matches(match->instance, window->class_instance)) {
LOG("window instance matches (%s)\n", window->class_instance);
} else {
- LOG("window instance does not match\n");
return false;
}
}
regex_matches(match->title, window->name_json)) {
LOG("title matches (%s)\n", window->name_json);
} else {
- LOG("title does not match\n");
return false;
}
}
regex_matches(match->role, window->role)) {
LOG("window_role matches (%s)\n", window->role);
} else {
- LOG("window_role does not match\n");
return false;
}
}
if (match->dock != -1) {
- LOG("match->dock = %d, window->dock = %d\n", match->dock, window->dock);
if ((window->dock == W_DOCK_TOP && match->dock == M_DOCK_TOP) ||
(window->dock == W_DOCK_BOTTOM && match->dock == M_DOCK_BOTTOM) ||
((window->dock == W_DOCK_TOP || window->dock == W_DOCK_BOTTOM) &&
int x = con->rect.x;
int y = con->rect.y;
int height = con->rect.height;
- DLOG("Available height: %d\n", height);
/* Find the content container and ensure that there is exactly one. Also
* check for any non-CT_DOCKAREA clients. */
Con *ws = con_get_fullscreen_con(content, CF_OUTPUT);
Con *fullscreen = con_get_fullscreen_con(ws, CF_OUTPUT);
if (fullscreen) {
- DLOG("got fs node: %p\n", fullscreen);
fullscreen->rect = con->rect;
x_raise_con(fullscreen);
render_con(fullscreen, true);
child->rect.height = 0;
TAILQ_FOREACH(dockchild, &(child->nodes_head), nodes)
child->rect.height += dockchild->geometry.height;
- DLOG("This dockarea's height: %d\n", child->rect.height);
height -= child->rect.height;
}
- DLOG("Remaining: %d\n", height);
-
/* Second pass: Set the widths/heights */
TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
if (child->type == CT_CON) {
DLOG("child at (%d, %d) with (%d x %d)\n",
child->rect.x, child->rect.y, child->rect.width, child->rect.height);
- DLOG("x now %d, y now %d\n", x, y);
x_raise_con(child);
render_con(child, false);
}
*
*/
void render_con(Con *con, bool render_fullscreen) {
- DLOG("currently rendering node %p / %s / layout %d\n",
- con, con->name, con->layout);
int children = con_num_children(con);
- DLOG("children: %d, orientation = %d\n", children, con->orientation);
+ DLOG("Rendering %snode %p / %s / layout %d / children %d / orient %d\n",
+ (render_fullscreen ? "fullscreen " : ""), con, con->name, con->layout,
+ children, con->orientation);
/* Copy container rect, subtract container border */
/* This is the actually usable space inside this container for clients */
if (!render_fullscreen)
*inset = rect_add(*inset, con_border_style_rect(con));
- DLOG("Starting with inset = (%d, %d) %d x %d\n", inset->x, inset->y, inset->width, inset->height);
/* Obey x11 border */
- DLOG("X11 border: %d\n", con->border_width);
inset->width -= (2 * con->border_width);
inset->height -= (2 * con->border_width);
/* Obey the aspect ratio, if any */
if (con->proportional_height != 0 &&
con->proportional_width != 0) {
- DLOG("proportional height = %d, width = %d\n", con->proportional_height, con->proportional_width);
double new_height = inset->height + 1;
int new_width = inset->width;
inset->height = new_height;
inset->width = new_width;
- DLOG("new_height = %f, new_width = %d\n", new_height, new_width);
}
if (con->height_increment > 1) {
fullscreen = con_get_fullscreen_con(con, (con->type == CT_ROOT ? CF_GLOBAL : CF_OUTPUT));
}
if (fullscreen) {
- DLOG("got fs node: %p\n", fullscreen);
fullscreen->rect = rect;
x_raise_con(fullscreen);
render_con(fullscreen, true);
if (con->layout == L_OUTPUT) {
render_l_output(con);
} else if (con->type == CT_ROOT) {
- DLOG("Root node, rendering outputs\n");
Con *child;
TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
render_con(child, false);
/* first we have the decoration, if this is a leaf node */
if (con_is_leaf(child) && child->border_style == BS_NORMAL) {
- DLOG("that child is a leaf node, subtracting deco\n");
/* TODO: make a function for relative coords? */
child->deco_rect.x = child->rect.x - con->rect.x;
child->deco_rect.y = child->rect.y - con->rect.y;
/* stacked layout */
else if (con->layout == L_STACKED) {
- DLOG("stacked con\n");
child->rect.x = x;
child->rect.y = y;
child->rect.width = rect.width;
/* tabbed layout */
else if (con->layout == L_TABBED) {
- DLOG("tabbed con\n");
child->rect.x = x;
child->rect.y = y;
child->rect.width = rect.width;
/* dockarea layout */
else if (con->layout == L_DOCKAREA) {
- DLOG("dockarea con\n");
child->rect.x = x;
child->rect.y = y;
child->rect.width = rect.width;
DLOG("child at (%d, %d) with (%d x %d)\n",
child->rect.x, child->rect.y, child->rect.width, child->rect.height);
- DLOG("x now %d, y now %d\n", x, y);
x_raise_con(child);
render_con(child, false);
i++;
/* in a stacking or tabbed container, we ensure the focused client is raised */
if (con->layout == L_STACKED || con->layout == L_TABBED) {
- DLOG("stacked/tabbed, raising focused reverse\n");
TAILQ_FOREACH_REVERSE(child, &(con->focus_head), focus_head, focused)
x_raise_con(child);
- DLOG("done\n");
if ((child = TAILQ_FIRST(&(con->focus_head)))) {
- DLOG("con %p is stacking, raising %p\n", con, child);
/* By rendering the stacked container again, we handle the case
* that we have a non-leaf-container inside the stack. In that
* case, the children of the non-leaf-container need to be raised
Con *child;
TAILQ_FOREACH(child, &(con->floating_head), floating_windows) {
- DLOG("render floating:\n");
DLOG("floating child at (%d,%d) with %d x %d\n", child->rect.x, child->rect.y, child->rect.width, child->rect.height);
x_raise_con(child);
render_con(child, false);
}
-
- DLOG("-- level up\n");
}
*/
void window_update_class(i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt) {
if (prop == NULL || xcb_get_property_value_length(prop) == 0) {
- DLOG("empty property, not updating\n");
+ DLOG("WM_CLASS not set.\n");
FREE(prop);
return;
}
*/
void window_update_name_legacy(i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt) {
if (prop == NULL || xcb_get_property_value_length(prop) == 0) {
- DLOG("prop == NULL\n");
+ DLOG("WM_NAME not set (_NET_WM_NAME is what you want anyways).\n");
FREE(prop);
return;
}
*/
void window_update_leader(i3Window *win, xcb_get_property_reply_t *prop) {
if (prop == NULL || xcb_get_property_value_length(prop) == 0) {
- DLOG("prop == NULL\n");
+ DLOG("CLIENT_LEADER not set.\n");
FREE(prop);
return;
}
*/
void window_update_transient_for(i3Window *win, xcb_get_property_reply_t *prop) {
if (prop == NULL || xcb_get_property_value_length(prop) == 0) {
- DLOG("prop == NULL\n");
+ DLOG("TRANSIENT_FOR not set.\n");
FREE(prop);
return;
}
*/
void window_update_strut_partial(i3Window *win, xcb_get_property_reply_t *prop) {
if (prop == NULL || xcb_get_property_value_length(prop) == 0) {
- DLOG("prop == NULL\n");
+ DLOG("_NET_WM_STRUT_PARTIAL not set.\n");
FREE(prop);
return;
}
*/
void window_update_role(i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt) {
if (prop == NULL || xcb_get_property_value_length(prop) == 0) {
- DLOG("prop == NULL\n");
+ DLOG("WM_WINDOW_ROLE not set.\n");
FREE(prop);
return;
}
parent->layout != L_TABBED) ||
con->type == CT_FLOATING_CON)
return;
- DLOG("decoration should be rendered for con %p\n", con);
/* Skip containers whose height is 0 (for example empty dockareas) */
- if (con->rect.height == 0) {
- DLOG("height == 0, not rendering\n");
+ if (con->rect.height == 0)
return;
- }
/* Skip containers whose pixmap has not yet been created (can happen when
* decoration rendering happens recursively for a window for which
* x_push_node() was not yet called) */
- if (leaf && con->pixmap == XCB_NONE) {
- DLOG("pixmap not yet created, not rendering\n");
+ if (leaf && con->pixmap == XCB_NONE)
return;
- }
/* 1: build deco_params and compare with cache */
struct deco_render_params *p = scalloc(sizeof(struct deco_render_params));
!parent->pixmap_recreated &&
!con->pixmap_recreated &&
memcmp(p, con->deco_render_params, sizeof(struct deco_render_params)) == 0) {
- DLOG("CACHE HIT, copying existing pixmaps\n");
free(p);
goto copy_pixmaps;
}
- DLOG("CACHE MISS\n");
Con *next = con;
while ((next = TAILQ_NEXT(next, nodes))) {
- DLOG("Also invalidating cache of %p\n", next);
FREE(next->deco_render_params);
}
/* if this is a borderless/1pixel window, we don’t * need to render the
* decoration. */
- if (p->border_style != BS_NORMAL) {
- DLOG("border style not BS_NORMAL, aborting rendering of decoration\n");
+ if (p->border_style != BS_NORMAL)
goto copy_pixmaps;
- }
/* 4: paint the bar */
xcb_change_gc_single(conn, parent->pm_gc, XCB_GC_FOREGROUND, p->color->background);
Con *il_parent = parent;
if (il_parent->layout != L_STACKED) {
while (1) {
- DLOG("il_parent = %p, layout = %d\n", il_parent, il_parent->layout);
+ //DLOG("il_parent = %p, layout = %d\n", il_parent, il_parent->layout);
if (il_parent->layout == L_STACKED)
indent_level++;
if (il_parent->type == CT_WORKSPACE || il_parent->type == CT_DOCKAREA || il_parent->type == CT_OUTPUT)
indent_mult++;
}
}
- DLOG("indent_level = %d, indent_mult = %d\n", indent_level, indent_mult);
+ //DLOG("indent_level = %d, indent_mult = %d\n", indent_level, indent_mult);
int indent_px = (indent_level * 5) * indent_mult;
if (win->uses_net_wm_name)
}
}
rect.height = max_y + max_height;
- if (rect.height == 0) {
- DLOG("Unmapping container %p because it does not contain anything.\n", con);
+ if (rect.height == 0)
con->mapped = false;
- }
}
/* reparent the child window (when the window was moved due to a sticky
* (height == 0). */
if ((state->rect.width != rect.width ||
state->rect.height != rect.height)) {
- DLOG("CACHE: creating new pixmap for con %p (old: %d x %d, new: %d x %d)\n",
- con, state->rect.width, state->rect.height,
- rect.width, rect.height);
if (con->pixmap == 0) {
con->pixmap = xcb_generate_id(conn);
con->pm_gc = xcb_generate_id(conn);
order_changed = true;
if ((state->initial || order_changed) && prev != CIRCLEQ_END(&state_head)) {
stacking_changed = true;
- DLOG("Stacking 0x%08x above 0x%08x\n", prev->id, state->id);
+ //DLOG("Stacking 0x%08x above 0x%08x\n", prev->id, state->id);
uint32_t mask = 0;
mask |= XCB_CONFIG_WINDOW_SIBLING;
mask |= XCB_CONFIG_WINDOW_STACK_MODE;
if (stacking_changed)
ewmh_update_client_list_stacking(btt_stack, btt_stack_num);
- DLOG("\n\n PUSHING CHANGES\n\n");
+ DLOG("PUSHING CHANGES\n");
x_push_node(con);
//DLOG("Re-enabling EnterNotify\n");
if (focused->window != NULL)
to_focus = focused->window->id;
- DLOG("focused_id = 0x%08x, to_focus = 0x%08x\n", focused_id, to_focus);
if (focused_id != to_focus) {
if (!focused->mapped) {
DLOG("Not updating focus (to %p / %s), focused window is not mapped.\n", focused, focused->name);
}
xcb_flush(conn);
- DLOG("\n\n ENDING CHANGES\n\n");
+ DLOG("ENDING CHANGES\n");
/* Disable EnterWindow events for windows which will be unmapped in
* x_push_node_unmaps() now. Unmapping windows happens when switching