free(full);
-#if 0
- free(command);
- return 1;
-#endif
exit(0);
}
*/
void floating_move_to_pointer(Con *con);
-#if 0
-/**
- * Removes the floating client from its workspace and attaches it to the new
- * workspace. This is centralized here because it may happen if you move it
- * via keyboard and if you move it using your mouse.
- *
- */
-void floating_assign_to_workspace(Client *client, Workspace *new_workspace);
-
-/**
- * Called whenever the user clicks on a border (not the titlebar!) of a
- * floating window. Determines on which border the user clicked and launches
- * the drag_pointer function with the resize_callback.
- *
- */
-int floating_border_click(xcb_connection_t *conn, Client *client,
- xcb_button_press_event_t *event);
-
-#endif
/**
* Called when the user clicked on the titlebar of a floating window.
* Calls the drag_pointer function with the drag_window callback
*/
void floating_check_size(Con *floating_con);
-#if 0
-/**
- * Changes focus in the given direction for floating clients.
- *
- * Changing to the left/right means going to the previous/next floating client,
- * changing to top/bottom means cycling through the Z-index.
- *
- */
-void floating_focus_direction(xcb_connection_t *conn, Client *currently_focused,
- direction_t direction);
-
-/**
- * Moves the client 10px to the specified direction.
- *
- */
-void floating_move(xcb_connection_t *conn, Client *currently_focused,
- direction_t direction);
-
-/**
- * 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);
-
-#endif
/**
* This is the return value of a drag operation like drag_pointer.
*
void manage_window(xcb_window_t window,
xcb_get_window_attributes_cookie_t cookie,
bool needs_to_be_mapped);
-
-#if 0
-/**
- * reparent_window() gets called when a new window was opened and becomes a
- * child of the root window, or it gets called by us when we manage the
- * already existing windows at startup.
- *
- * Essentially, this is the point where we take over control.
- *
- */
-void reparent_window(xcb_connection_t *conn, xcb_window_t child,
- xcb_visualid_t visual, xcb_window_t root, uint8_t depth,
- int16_t x, int16_t y, uint16_t width, uint16_t height,
- uint32_t border_width);
-
-#endif
*/
Con *create_workspace_on_output(Output *output, Con *content);
-#if 0
-/**
- * Sets the name (or just its number) for the given workspace. This has to
- * be called for every workspace as the rendering function
- * (render_internal_bar) relies on workspace->name and workspace->name_len
- * being ready-to-use.
- *
- */
-void workspace_set_name(Workspace *ws, const char *name);
-#endif
-
/**
* Returns true if the workspace is currently visible. Especially important for
* multi-monitor environments, as they can have multiple currenlty active
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)
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
}
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
}
}
-#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;
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
return true;
}
-#if 0
-/*
- * Updates the client’s 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)
*
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 don’t just fill the whole
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
}