Codebase list i3-gaps / 152318b
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. Ingo Bürk authored 8 years ago Michael Stapelberg committed 8 years ago
9 changed file(s) with 1 addition(s) and 236 deletion(s). Raw diff Collapse all Expand all
215215
216216 free(full);
217217
218 #if 0
219 free(command);
220 return 1;
221 #endif
222218 exit(0);
223219 }
224220
7575 */
7676 void floating_move_to_pointer(Con *con);
7777
78 #if 0
79 /**
80 * Removes the floating client from its workspace and attaches it to the new
81 * workspace. This is centralized here because it may happen if you move it
82 * via keyboard and if you move it using your mouse.
83 *
84 */
85 void floating_assign_to_workspace(Client *client, Workspace *new_workspace);
86
87 /**
88 * Called whenever the user clicks on a border (not the titlebar!) of a
89 * floating window. Determines on which border the user clicked and launches
90 * the drag_pointer function with the resize_callback.
91 *
92 */
93 int floating_border_click(xcb_connection_t *conn, Client *client,
94 xcb_button_press_event_t *event);
95
96 #endif
9778 /**
9879 * Called when the user clicked on the titlebar of a floating window.
9980 * Calls the drag_pointer function with the drag_window callback
11798 */
11899 void floating_check_size(Con *floating_con);
119100
120 #if 0
121 /**
122 * Changes focus in the given direction for floating clients.
123 *
124 * Changing to the left/right means going to the previous/next floating client,
125 * changing to top/bottom means cycling through the Z-index.
126 *
127 */
128 void floating_focus_direction(xcb_connection_t *conn, Client *currently_focused,
129 direction_t direction);
130
131 /**
132 * Moves the client 10px to the specified direction.
133 *
134 */
135 void floating_move(xcb_connection_t *conn, Client *currently_focused,
136 direction_t direction);
137
138 /**
139 * Hides all floating clients (or show them if they are currently hidden) on
140 * the specified workspace.
141 *
142 */
143 void floating_toggle_hide(xcb_connection_t *conn, Workspace *workspace);
144
145 #endif
146101 /**
147102 * This is the return value of a drag operation like drag_pointer.
148103 *
3434 void manage_window(xcb_window_t window,
3535 xcb_get_window_attributes_cookie_t cookie,
3636 bool needs_to_be_mapped);
37
38 #if 0
39 /**
40 * reparent_window() gets called when a new window was opened and becomes a
41 * child of the root window, or it gets called by us when we manage the
42 * already existing windows at startup.
43 *
44 * Essentially, this is the point where we take over control.
45 *
46 */
47 void reparent_window(xcb_connection_t *conn, xcb_window_t child,
48 xcb_visualid_t visual, xcb_window_t root, uint8_t depth,
49 int16_t x, int16_t y, uint16_t width, uint16_t height,
50 uint32_t border_width);
51
52 #endif
4848 *
4949 */
5050 Con *create_workspace_on_output(Output *output, Con *content);
51
52 #if 0
53 /**
54 * Sets the name (or just its number) for the given workspace. This has to
55 * be called for every workspace as the rendering function
56 * (render_internal_bar) relies on workspace->name and workspace->name_len
57 * being ready-to-use.
58 *
59 */
60 void workspace_set_name(Workspace *ws, const char *name);
61 #endif
6251
6352 /**
6453 * Returns true if the workspace is currently visible. Especially important for
159159 FREE(barconfig);
160160 }
161161
162 /* Clear workspace names */
163 #if 0
164 Workspace *ws;
165 TAILQ_FOREACH(ws, workspaces, workspaces)
166 workspace_set_name(ws, NULL);
167 #endif
168
169162 /* Invalidate pixmap caches in case font or colors changed */
170163 Con *con;
171164 TAILQ_FOREACH(con, &all_cons, all_cons)
253246 x_deco_recurse(croot);
254247 xcb_flush(conn);
255248 }
256
257 #if 0
258 /* Set an empty name for every workspace which got no name */
259 Workspace *ws;
260 TAILQ_FOREACH(ws, workspaces, workspaces) {
261 if (ws->name != NULL) {
262 /* If the font was not specified when the workspace name
263 * was loaded, we need to predict the text width now */
264 if (ws->text_width == 0)
265 ws->text_width = predict_text_width(global_conn,
266 config.font, ws->name, ws->name_len);
267 continue;
268 }
269
270 workspace_set_name(ws, NULL);
271 }
272 #endif
273 }
249 }
885885 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);
886886 DLOG("Resulting coordinates: x = %d, y = %d\n", con->rect.x, con->rect.y);
887887 }
888
889 #if 0
890 /*
891 * Moves the client 10px to the specified direction.
892 *
893 */
894 void floating_move(xcb_connection_t *conn, Client *currently_focused, direction_t direction) {
895 DLOG("floating move\n");
896
897 Rect destination = currently_focused->rect;
898 Rect *screen = &(currently_focused->workspace->output->rect);
899
900 switch (direction) {
901 case D_LEFT:
902 destination.x -= 10;
903 break;
904 case D_RIGHT:
905 destination.x += 10;
906 break;
907 case D_UP:
908 destination.y -= 10;
909 break;
910 case D_DOWN:
911 destination.y += 10;
912 break;
913 /* to make static analyzers happy */
914 default:
915 break;
916 }
917
918 /* Prevent windows from vanishing completely */
919 if ((int32_t)(destination.x + destination.width - 5) <= (int32_t)screen->x ||
920 (int32_t)(destination.x + 5) >= (int32_t)(screen->x + screen->width) ||
921 (int32_t)(destination.y + destination.height - 5) <= (int32_t)screen->y ||
922 (int32_t)(destination.y + 5) >= (int32_t)(screen->y + screen->height)) {
923 DLOG("boundary check failed, not moving\n");
924 return;
925 }
926
927 currently_focused->rect = destination;
928 reposition_client(conn, currently_focused);
929
930 /* Because reposition_client does not send a faked configure event (only resize does),
931 * we need to initiate that on our own */
932 fake_absolute_configure_notify(conn, currently_focused);
933 /* fake_absolute_configure_notify flushes */
934 }
935
936 /*
937 * Hides all floating clients (or show them if they are currently hidden) on
938 * the specified workspace.
939 *
940 */
941 void floating_toggle_hide(xcb_connection_t *conn, Workspace *workspace) {
942 Client *client;
943
944 workspace->floating_hidden = !workspace->floating_hidden;
945 DLOG("floating_hidden is now: %d\n", workspace->floating_hidden);
946 TAILQ_FOREACH(client, &(workspace->floating_clients), floating_clients) {
947 if (workspace->floating_hidden)
948 client_unmap(conn, client);
949 else client_map(conn, client);
950 }
951
952 /* If we just unmapped all floating windows we should ensure that the focus
953 * is set correctly, that ist, to the first non-floating client in stack */
954 if (workspace->floating_hidden)
955 SLIST_FOREACH(client, &(workspace->focus_stack), focus_clients) {
956 if (client_is_floating(client))
957 continue;
958 set_focus(conn, client, true);
959 return;
960 }
961
962 xcb_flush(conn);
963 }
964 #endif
171171 }
172172 }
173173
174 #if 0
175 if (client->workspace != c_ws && client->workspace->output == c_ws->output) {
176 /* This can happen when a client gets assigned to a different workspace than
177 * the current one (see src/mainx.c:reparent_window). Shortly after it was created,
178 * an enter_notify will follow. */
179 DLOG("enter_notify for a client on a different workspace but the same screen, ignoring\n");
180 return 1;
181 }
182 #endif
183
184174 if (config.disable_focus_follows_mouse)
185175 return;
186176
420410
421411 return;
422412 }
423 #if 0
424
425 /*
426 * Configuration notifies are only handled because we need to set up ignore for
427 * the following enter notify events.
428 *
429 */
430 int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_notify_event_t *event) {
431 DLOG("configure_event, sequence %d\n", event->sequence);
432 /* We ignore this sequence twice because events for child and frame should be ignored */
433 add_ignore_event(event->sequence);
434 add_ignore_event(event->sequence);
435
436 return 1;
437 }
438 #endif
439413
440414 /*
441415 * Gets triggered upon a RandR screen change event, that is when the user
628602
629603 return true;
630604 }
631
632 #if 0
633 /*
634 * Updates the client’s WM_CLASS property
635 *
636 */
637 static int handle_windowclass_change(void *data, xcb_connection_t *conn, uint8_t state,
638 xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop) {
639 Con *con;
640 if ((con = con_by_window_id(window)) == NULL || con->window == NULL)
641 return 1;
642
643 window_update_class(con->window, prop, false);
644
645 return 0;
646 }
647 #endif
648605
649606 /*
650607 * Expose event means we should redraw our windows (= title bar)
463463 borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders;
464464
465465 Rect br = con_border_style_rect(con);
466 #if 0
467 DLOG("con->rect spans %d x %d\n", con->rect.width, con->rect.height);
468 DLOG("border_rect spans (%d, %d) with %d x %d\n", br.x, br.y, br.width, br.height);
469 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);
470 #endif
471466
472467 /* These rectangles represent the border around the child window
473468 * (left, bottom and right part). We don’t just fill the whole
120120
121121 FREE(reply);
122122 }
123
124 #if 0
125 Output *output;
126 Workspace *ws;
127 /* Just go through each active output and associate one workspace */
128 TAILQ_FOREACH(output, &outputs, outputs) {
129 ws = get_first_workspace_for_output(output);
130 initialize_output(conn, output, ws);
131 }
132 #endif
133123 }