Remove dead code guarded with "#if 0 … #endif" (#2338)

This code has been neutralized for many years now and served no purpose
other than cluttering up the code. We obviously don't need it and it's
out of date anyway.

If there's ever any reason to restore (parts of) it, we have git for
that. But we don't need to keep commented out code around.
This commit is contained in:
Ingo Bürk
2016-05-05 14:18:04 +02:00
committed by Michael Stapelberg
parent d242ae1745
commit 152318bccf
9 changed files with 0 additions and 235 deletions

View File

@ -160,13 +160,6 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
FREE(barconfig);
}
/* Clear workspace names */
#if 0
Workspace *ws;
TAILQ_FOREACH(ws, workspaces, workspaces)
workspace_set_name(ws, NULL);
#endif
/* Invalidate pixmap caches in case font or colors changed */
Con *con;
TAILQ_FOREACH(con, &all_cons, all_cons)
@ -254,21 +247,4 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
x_deco_recurse(croot);
xcb_flush(conn);
}
#if 0
/* Set an empty name for every workspace which got no name */
Workspace *ws;
TAILQ_FOREACH(ws, workspaces, workspaces) {
if (ws->name != NULL) {
/* If the font was not specified when the workspace name
* was loaded, we need to predict the text width now */
if (ws->text_width == 0)
ws->text_width = predict_text_width(global_conn,
config.font, ws->name, ws->name_len);
continue;
}
workspace_set_name(ws, NULL);
}
#endif
}

View File

@ -886,80 +886,3 @@ void floating_fix_coordinates(Con *con, Rect *old_rect, Rect *new_rect) {
con->rect.y = (int32_t)new_rect->y + (double)(rel_y * (int32_t)new_rect->height) / (int32_t)old_rect->height - (int32_t)(con->rect.height / 2);
DLOG("Resulting coordinates: x = %d, y = %d\n", con->rect.x, con->rect.y);
}
#if 0
/*
* Moves the client 10px to the specified direction.
*
*/
void floating_move(xcb_connection_t *conn, Client *currently_focused, direction_t direction) {
DLOG("floating move\n");
Rect destination = currently_focused->rect;
Rect *screen = &(currently_focused->workspace->output->rect);
switch (direction) {
case D_LEFT:
destination.x -= 10;
break;
case D_RIGHT:
destination.x += 10;
break;
case D_UP:
destination.y -= 10;
break;
case D_DOWN:
destination.y += 10;
break;
/* to make static analyzers happy */
default:
break;
}
/* Prevent windows from vanishing completely */
if ((int32_t)(destination.x + destination.width - 5) <= (int32_t)screen->x ||
(int32_t)(destination.x + 5) >= (int32_t)(screen->x + screen->width) ||
(int32_t)(destination.y + destination.height - 5) <= (int32_t)screen->y ||
(int32_t)(destination.y + 5) >= (int32_t)(screen->y + screen->height)) {
DLOG("boundary check failed, not moving\n");
return;
}
currently_focused->rect = destination;
reposition_client(conn, currently_focused);
/* Because reposition_client does not send a faked configure event (only resize does),
* we need to initiate that on our own */
fake_absolute_configure_notify(conn, currently_focused);
/* fake_absolute_configure_notify flushes */
}
/*
* Hides all floating clients (or show them if they are currently hidden) on
* the specified workspace.
*
*/
void floating_toggle_hide(xcb_connection_t *conn, Workspace *workspace) {
Client *client;
workspace->floating_hidden = !workspace->floating_hidden;
DLOG("floating_hidden is now: %d\n", workspace->floating_hidden);
TAILQ_FOREACH(client, &(workspace->floating_clients), floating_clients) {
if (workspace->floating_hidden)
client_unmap(conn, client);
else client_map(conn, client);
}
/* If we just unmapped all floating windows we should ensure that the focus
* is set correctly, that ist, to the first non-floating client in stack */
if (workspace->floating_hidden)
SLIST_FOREACH(client, &(workspace->focus_stack), focus_clients) {
if (client_is_floating(client))
continue;
set_focus(conn, client, true);
return;
}
xcb_flush(conn);
}
#endif

View File

@ -172,16 +172,6 @@ static void handle_enter_notify(xcb_enter_notify_event_t *event) {
}
}
#if 0
if (client->workspace != c_ws && client->workspace->output == c_ws->output) {
/* This can happen when a client gets assigned to a different workspace than
* the current one (see src/mainx.c:reparent_window). Shortly after it was created,
* an enter_notify will follow. */
DLOG("enter_notify for a client on a different workspace but the same screen, ignoring\n");
return 1;
}
#endif
if (config.disable_focus_follows_mouse)
return;
@ -421,22 +411,6 @@ static void handle_configure_request(xcb_configure_request_event_t *event) {
return;
}
#if 0
/*
* Configuration notifies are only handled because we need to set up ignore for
* the following enter notify events.
*
*/
int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_notify_event_t *event) {
DLOG("configure_event, sequence %d\n", event->sequence);
/* We ignore this sequence twice because events for child and frame should be ignored */
add_ignore_event(event->sequence);
add_ignore_event(event->sequence);
return 1;
}
#endif
/*
* Gets triggered upon a RandR screen change event, that is when the user
@ -630,23 +604,6 @@ static bool handle_windowrole_change(void *data, xcb_connection_t *conn, uint8_t
return true;
}
#if 0
/*
* Updates the clients WM_CLASS property
*
*/
static int handle_windowclass_change(void *data, xcb_connection_t *conn, uint8_t state,
xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop) {
Con *con;
if ((con = con_by_window_id(window)) == NULL || con->window == NULL)
return 1;
window_update_class(con->window, prop, false);
return 0;
}
#endif
/*
* Expose event means we should redraw our windows (= title bar)
*

View File

@ -464,11 +464,6 @@ void x_draw_decoration(Con *con) {
borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders;
Rect br = con_border_style_rect(con);
#if 0
DLOG("con->rect spans %d x %d\n", con->rect.width, con->rect.height);
DLOG("border_rect spans (%d, %d) with %d x %d\n", br.x, br.y, br.width, br.height);
DLOG("window_rect spans (%d, %d) with %d x %d\n", con->window_rect.x, con->window_rect.y, con->window_rect.width, con->window_rect.height);
#endif
/* These rectangles represent the border around the child window
* (left, bottom and right part). We dont just fill the whole

View File

@ -121,14 +121,4 @@ void xinerama_init(void) {
FREE(reply);
}
#if 0
Output *output;
Workspace *ws;
/* Just go through each active output and associate one workspace */
TAILQ_FOREACH(output, &outputs, outputs) {
ws = get_first_workspace_for_output(output);
initialize_output(conn, output, ws);
}
#endif
}