Remove outdated //-style commented-out code
This makes the whole code-base have zero changes with clang-format (v13).
This commit is contained in:
parent
70f23caa9a
commit
a4ac843cca
@ -332,8 +332,6 @@ static char *rewrite_binding(const char *input) {
|
|||||||
while ((*walk == ' ' || *walk == '\t') && *walk != '\0')
|
while ((*walk == ' ' || *walk == '\t') && *walk != '\0')
|
||||||
walk++;
|
walk++;
|
||||||
|
|
||||||
//printf("remaining input: %s\n", walk);
|
|
||||||
|
|
||||||
cmdp_token_ptr *ptr = &(tokens[state]);
|
cmdp_token_ptr *ptr = &(tokens[state]);
|
||||||
for (c = 0; c < ptr->n; c++) {
|
for (c = 0; c < ptr->n; c++) {
|
||||||
token = &(ptr->array[c]);
|
token = &(ptr->array[c]);
|
||||||
@ -426,15 +424,13 @@ static char *rewrite_binding(const char *input) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(token->name, "end") == 0) {
|
if (strcmp(token->name, "end") == 0) {
|
||||||
//printf("checking for end: *%s*\n", walk);
|
|
||||||
if (*walk == '\0' || *walk == '\n' || *walk == '\r') {
|
if (*walk == '\0' || *walk == '\n' || *walk == '\r') {
|
||||||
if ((result = next_state(token)) != NULL)
|
if ((result = next_state(token)) != NULL)
|
||||||
return result;
|
return result;
|
||||||
/* To make sure we start with an appropriate matching
|
/* To make sure we start with an appropriate matching data
|
||||||
* datastructure for commands which do *not* specify any
|
* structure for commands which do *not* specify any
|
||||||
* criteria, we re-initialize the criteria system after
|
* criteria, we re-initialize the criteria system after
|
||||||
* every command. */
|
* every command. */
|
||||||
// TODO: make this testable
|
|
||||||
walk++;
|
walk++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -50,12 +50,6 @@ void output_init_con(Output *output);
|
|||||||
*/
|
*/
|
||||||
void init_ws_for_output(Output *output);
|
void init_ws_for_output(Output *output);
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the specified output, assigning the specified workspace to it.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
//void initialize_output(xcb_connection_t *conn, Output *output, Workspace *workspace);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (Re-)queries the outputs via RandR and stores them in the list of outputs.
|
* (Re-)queries the outputs via RandR and stores them in the list of outputs.
|
||||||
*
|
*
|
||||||
|
15
src/con.c
15
src/con.c
@ -887,8 +887,6 @@ void con_unmark(Con *con, const char *name) {
|
|||||||
Con *con_for_window(Con *con, i3Window *window, Match **store_match) {
|
Con *con_for_window(Con *con, i3Window *window, Match **store_match) {
|
||||||
Con *child;
|
Con *child;
|
||||||
Match *match;
|
Match *match;
|
||||||
//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 (child, &(con->nodes_head), nodes) {
|
||||||
TAILQ_FOREACH (match, &(child->swallow_head), matches) {
|
TAILQ_FOREACH (match, &(child->swallow_head), matches) {
|
||||||
@ -1047,8 +1045,8 @@ void con_fix_percent(Con *con) {
|
|||||||
Con *child;
|
Con *child;
|
||||||
int children = con_num_children(con);
|
int children = con_num_children(con);
|
||||||
|
|
||||||
// calculate how much we have distributed and how many containers
|
/* calculate how much we have distributed and how many containers with a
|
||||||
// with a percentage set we have
|
* percentage set we have */
|
||||||
double total = 0.0;
|
double total = 0.0;
|
||||||
int children_with_percent = 0;
|
int children_with_percent = 0;
|
||||||
TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
|
TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
|
||||||
@ -1058,8 +1056,8 @@ void con_fix_percent(Con *con) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there were children without a percentage set, set to a value that
|
/* if there were children without a percentage set, set to a value that
|
||||||
// will make those children proportional to all others
|
* will make those children proportional to all others */
|
||||||
if (children_with_percent != children) {
|
if (children_with_percent != children) {
|
||||||
TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
|
TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
|
||||||
if (child->percent <= 0.0) {
|
if (child->percent <= 0.0) {
|
||||||
@ -1072,8 +1070,8 @@ void con_fix_percent(Con *con) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we got a zero, just distribute the space equally, otherwise
|
/* if we got a zero, just distribute the space equally, otherwise
|
||||||
// distribute according to the proportions we got
|
* distribute according to the proportions we got */
|
||||||
if (total == 0.0) {
|
if (total == 0.0) {
|
||||||
TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
|
TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
|
||||||
child->percent = 1.0 / children;
|
child->percent = 1.0 / children;
|
||||||
@ -2237,7 +2235,6 @@ void con_set_urgency(Con *con, bool urgent) {
|
|||||||
} else
|
} else
|
||||||
DLOG("Discarding urgency WM_HINT because timer is running\n");
|
DLOG("Discarding urgency WM_HINT because timer is running\n");
|
||||||
|
|
||||||
//CLIENT_LOG(con);
|
|
||||||
if (con->window) {
|
if (con->window) {
|
||||||
if (con->urgent) {
|
if (con->urgent) {
|
||||||
gettimeofday(&con->window->urgent, NULL);
|
gettimeofday(&con->window->urgent, NULL);
|
||||||
|
@ -165,8 +165,6 @@ static void clear_stack(struct stack *ctx) {
|
|||||||
static void next_state(const cmdp_token *token, struct parser_ctx *ctx) {
|
static void next_state(const cmdp_token *token, struct parser_ctx *ctx) {
|
||||||
cmdp_state _next_state = token->next_state;
|
cmdp_state _next_state = token->next_state;
|
||||||
|
|
||||||
//printf("token = name %s identifier %s\n", token->name, token->identifier);
|
|
||||||
//printf("next_state = %d\n", token->next_state);
|
|
||||||
if (token->next_state == __CALL) {
|
if (token->next_state == __CALL) {
|
||||||
struct ConfigResultIR subcommand_output = {
|
struct ConfigResultIR subcommand_output = {
|
||||||
.ctx = ctx,
|
.ctx = ctx,
|
||||||
@ -254,7 +252,6 @@ static void parse_config(struct parser_ctx *ctx, const char *input, struct conte
|
|||||||
bool token_handled;
|
bool token_handled;
|
||||||
linecnt = 1;
|
linecnt = 1;
|
||||||
|
|
||||||
// TODO: make this testable
|
|
||||||
#ifndef TEST_PARSER
|
#ifndef TEST_PARSER
|
||||||
struct ConfigResultIR subcommand_output = {
|
struct ConfigResultIR subcommand_output = {
|
||||||
.ctx = ctx,
|
.ctx = ctx,
|
||||||
@ -270,8 +267,6 @@ static void parse_config(struct parser_ctx *ctx, const char *input, struct conte
|
|||||||
while ((*walk == ' ' || *walk == '\t') && *walk != '\0')
|
while ((*walk == ' ' || *walk == '\t') && *walk != '\0')
|
||||||
walk++;
|
walk++;
|
||||||
|
|
||||||
//printf("remaining input: %s\n", walk);
|
|
||||||
|
|
||||||
cmdp_token_ptr *ptr = &(tokens[ctx->state]);
|
cmdp_token_ptr *ptr = &(tokens[ctx->state]);
|
||||||
token_handled = false;
|
token_handled = false;
|
||||||
for (c = 0; c < ptr->n; c++) {
|
for (c = 0; c < ptr->n; c++) {
|
||||||
@ -378,7 +373,6 @@ static void parse_config(struct parser_ctx *ctx, const char *input, struct conte
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(token->name, "end") == 0) {
|
if (strcmp(token->name, "end") == 0) {
|
||||||
//printf("checking for end: *%s*\n", walk);
|
|
||||||
if (*walk == '\0' || *walk == '\n' || *walk == '\r') {
|
if (*walk == '\0' || *walk == '\n' || *walk == '\r') {
|
||||||
next_state(token, ctx);
|
next_state(token, ctx);
|
||||||
token_handled = true;
|
token_handled = true;
|
||||||
@ -386,7 +380,6 @@ static void parse_config(struct parser_ctx *ctx, const char *input, struct conte
|
|||||||
* datastructure for commands which do *not* specify any
|
* datastructure for commands which do *not* specify any
|
||||||
* criteria, we re-initialize the criteria system after
|
* criteria, we re-initialize the criteria system after
|
||||||
* every command. */
|
* every command. */
|
||||||
// TODO: make this testable
|
|
||||||
#ifndef TEST_PARSER
|
#ifndef TEST_PARSER
|
||||||
cfg_criteria_init(&(ctx->current_match), &subcommand_output, INITIAL);
|
cfg_criteria_init(&(ctx->current_match), &subcommand_output, INITIAL);
|
||||||
#endif
|
#endif
|
||||||
|
@ -70,11 +70,9 @@ bool event_is_ignored(const int sequence, const int response_type) {
|
|||||||
event->response_type != response_type)
|
event->response_type != response_type)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* instead of removing a sequence number we better wait until it gets
|
/* Instead of removing & freeing a sequence number we better wait until
|
||||||
* garbage collected. it may generate multiple events (there are multiple
|
* it gets garbage collected. It may generate multiple events (there
|
||||||
* enter_notifies for one configure_request, for example). */
|
* are multiple enter_notifies for one configure_request, for example). */
|
||||||
//SLIST_REMOVE(&ignore_events, event, Ignore_Event, ignore_events);
|
|
||||||
//free(event);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1346,7 +1344,7 @@ static void property_notify(uint8_t state, xcb_window_t window, xcb_atom_t atom)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (handler == NULL) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1524,7 +1522,7 @@ void handle_event(int type, xcb_generic_event_t *event) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
//DLOG("Unhandled event of type %d\n", type);
|
/* DLOG("Unhandled event of type %d\n", type); */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
21
src/x.c
21
src/x.c
@ -881,7 +881,6 @@ void x_push_node(Con *con) {
|
|||||||
con_state *state;
|
con_state *state;
|
||||||
Rect rect = con->rect;
|
Rect rect = con->rect;
|
||||||
|
|
||||||
//DLOG("Pushing changes for node %p / %s\n", con, con->name);
|
|
||||||
state = state_for_frame(con->frame.id);
|
state = state_for_frame(con->frame.id);
|
||||||
|
|
||||||
if (state->name != NULL) {
|
if (state->name != NULL) {
|
||||||
@ -994,8 +993,9 @@ void x_push_node(Con *con) {
|
|||||||
win_depth = con->window->depth;
|
win_depth = con->window->depth;
|
||||||
|
|
||||||
/* Ensure we have valid dimensions for our surface. */
|
/* Ensure we have valid dimensions for our surface. */
|
||||||
// TODO This is probably a bug in the condition above as we should never enter this path
|
/* TODO: This is probably a bug in the condition above as we should
|
||||||
// for height == 0. Also, we should probably handle width == 0 the same way.
|
* never enter this path for height == 0. Also, we should probably
|
||||||
|
* handle width == 0 the same way. */
|
||||||
int width = MAX((int32_t)rect.width, 1);
|
int width = MAX((int32_t)rect.width, 1);
|
||||||
int height = MAX((int32_t)rect.height, 1);
|
int height = MAX((int32_t)rect.height, 1);
|
||||||
|
|
||||||
@ -1014,8 +1014,8 @@ void x_push_node(Con *con) {
|
|||||||
con->pixmap_recreated = true;
|
con->pixmap_recreated = true;
|
||||||
|
|
||||||
/* Don’t render the decoration for windows inside a stack which are
|
/* Don’t render the decoration for windows inside a stack which are
|
||||||
* not visible right now */
|
* not visible right now
|
||||||
// TODO Should this work the same way for L_TABBED?
|
* TODO: Should this work the same way for L_TABBED? */
|
||||||
if (!con->parent ||
|
if (!con->parent ||
|
||||||
con->parent->layout != L_STACKED ||
|
con->parent->layout != L_STACKED ||
|
||||||
TAILQ_FIRST(&(con->parent->focus_head)) == con)
|
TAILQ_FIRST(&(con->parent->focus_head)) == con)
|
||||||
@ -1126,7 +1126,6 @@ static void x_push_node_unmaps(Con *con) {
|
|||||||
Con *current;
|
Con *current;
|
||||||
con_state *state;
|
con_state *state;
|
||||||
|
|
||||||
//DLOG("Pushing changes (with unmaps) for node %p / %s\n", con, con->name);
|
|
||||||
state = state_for_frame(con->frame.id);
|
state = state_for_frame(con->frame.id);
|
||||||
|
|
||||||
/* map/unmap if map state changed, also ensure that the child window
|
/* map/unmap if map state changed, also ensure that the child window
|
||||||
@ -1202,7 +1201,6 @@ void x_push_changes(Con *con) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DLOG("-- PUSHING WINDOW STACK --\n");
|
DLOG("-- PUSHING WINDOW STACK --\n");
|
||||||
//DLOG("Disabling EnterNotify\n");
|
|
||||||
/* We need to keep SubstructureRedirect around, otherwise clients can send
|
/* We need to keep SubstructureRedirect around, otherwise clients can send
|
||||||
* ConfigureWindow requests and get them applied directly instead of having
|
* ConfigureWindow requests and get them applied directly instead of having
|
||||||
* them become ConfigureRequests that i3 handles. */
|
* them become ConfigureRequests that i3 handles. */
|
||||||
@ -1211,7 +1209,6 @@ void x_push_changes(Con *con) {
|
|||||||
if (state->mapped)
|
if (state->mapped)
|
||||||
xcb_change_window_attributes(conn, state->id, XCB_CW_EVENT_MASK, values);
|
xcb_change_window_attributes(conn, state->id, XCB_CW_EVENT_MASK, values);
|
||||||
}
|
}
|
||||||
//DLOG("Done, EnterNotify disabled\n");
|
|
||||||
bool order_changed = false;
|
bool order_changed = false;
|
||||||
bool stacking_changed = false;
|
bool stacking_changed = false;
|
||||||
|
|
||||||
@ -1241,14 +1238,12 @@ void x_push_changes(Con *con) {
|
|||||||
if (con_has_managed_window(state->con))
|
if (con_has_managed_window(state->con))
|
||||||
memcpy(walk++, &(state->con->window->id), sizeof(xcb_window_t));
|
memcpy(walk++, &(state->con->window->id), sizeof(xcb_window_t));
|
||||||
|
|
||||||
//DLOG("stack: 0x%08x\n", state->id);
|
|
||||||
con_state *prev = CIRCLEQ_PREV(state, state);
|
con_state *prev = CIRCLEQ_PREV(state, state);
|
||||||
con_state *old_prev = CIRCLEQ_PREV(state, old_state);
|
con_state *old_prev = CIRCLEQ_PREV(state, old_state);
|
||||||
if (prev != old_prev)
|
if (prev != old_prev)
|
||||||
order_changed = true;
|
order_changed = true;
|
||||||
if ((state->initial || order_changed) && prev != CIRCLEQ_END(&state_head)) {
|
if ((state->initial || order_changed) && prev != CIRCLEQ_END(&state_head)) {
|
||||||
stacking_changed = true;
|
stacking_changed = true;
|
||||||
//DLOG("Stacking 0x%08x above 0x%08x\n", prev->id, state->id);
|
|
||||||
uint32_t mask = 0;
|
uint32_t mask = 0;
|
||||||
mask |= XCB_CONFIG_WINDOW_SIBLING;
|
mask |= XCB_CONFIG_WINDOW_SIBLING;
|
||||||
mask |= XCB_CONFIG_WINDOW_STACK_MODE;
|
mask |= XCB_CONFIG_WINDOW_STACK_MODE;
|
||||||
@ -1301,13 +1296,11 @@ void x_push_changes(Con *con) {
|
|||||||
warp_to = NULL;
|
warp_to = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//DLOG("Re-enabling EnterNotify\n");
|
|
||||||
values[0] = FRAME_EVENT_MASK;
|
values[0] = FRAME_EVENT_MASK;
|
||||||
CIRCLEQ_FOREACH_REVERSE (state, &state_head, state) {
|
CIRCLEQ_FOREACH_REVERSE (state, &state_head, state) {
|
||||||
if (state->mapped)
|
if (state->mapped)
|
||||||
xcb_change_window_attributes(conn, state->id, XCB_CW_EVENT_MASK, values);
|
xcb_change_window_attributes(conn, state->id, XCB_CW_EVENT_MASK, values);
|
||||||
}
|
}
|
||||||
//DLOG("Done, EnterNotify re-enabled\n");
|
|
||||||
|
|
||||||
x_deco_recurse(con);
|
x_deco_recurse(con);
|
||||||
|
|
||||||
@ -1393,9 +1386,6 @@ void x_push_changes(Con *con) {
|
|||||||
CIRCLEQ_REMOVE(&old_state_head, state, old_state);
|
CIRCLEQ_REMOVE(&old_state_head, state, old_state);
|
||||||
CIRCLEQ_INSERT_TAIL(&old_state_head, state, old_state);
|
CIRCLEQ_INSERT_TAIL(&old_state_head, state, old_state);
|
||||||
}
|
}
|
||||||
//CIRCLEQ_FOREACH(state, &old_state_head, old_state) {
|
|
||||||
// DLOG("old stack: 0x%08x\n", state->id);
|
|
||||||
//}
|
|
||||||
|
|
||||||
xcb_flush(conn);
|
xcb_flush(conn);
|
||||||
}
|
}
|
||||||
@ -1408,7 +1398,6 @@ void x_push_changes(Con *con) {
|
|||||||
void x_raise_con(Con *con) {
|
void x_raise_con(Con *con) {
|
||||||
con_state *state;
|
con_state *state;
|
||||||
state = state_for_frame(con->frame.id);
|
state = state_for_frame(con->frame.id);
|
||||||
//DLOG("raising in new stack: %p / %s / %s / xid %08x\n", con, con->name, con->window ? con->window->name_json : "", state->id);
|
|
||||||
|
|
||||||
CIRCLEQ_REMOVE(&state_head, state, state);
|
CIRCLEQ_REMOVE(&state_head, state, state);
|
||||||
CIRCLEQ_INSERT_HEAD(&state_head, state, state);
|
CIRCLEQ_INSERT_HEAD(&state_head, state, state);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user