4 * i3 - an improved dynamic tiling window manager
6 * © 2009 Michael Stapelberg and contributors
8 * See file LICENSE for license information.
14 /** Callback for dragging */
15 typedef void(*callback_t)(Rect*, uint32_t, uint32_t);
17 /** On which border was the dragging initiated? */
18 typedef enum { BORDER_LEFT, BORDER_RIGHT, BORDER_TOP, BORDER_BOTTOM} border_t;
21 * Enters floating mode for the given client.
22 * Correctly takes care of the position/size (separately stored for tiling/floating mode)
23 * and repositions/resizes/redecorates the client.
25 * If the automatic flag is set to true, this was an automatic update by a change of the
26 * window class from the application which can be overwritten by the user.
29 void toggle_floating_mode(xcb_connection_t *conn, Client *client, bool automatic);
32 * Removes the floating client from its workspace and attaches it to the new workspace.
33 * This is centralized here because it may happen if you move it via keyboard and
34 * if you move it using your mouse.
37 void floating_assign_to_workspace(Client *client, Workspace *new_workspace);
40 * Called whenever the user clicks on a border (not the titlebar!) of a floating window.
41 * Determines on which border the user clicked and launches the drag_pointer function
42 * with the resize_callback.
45 int floating_border_click(xcb_connection_t *conn, Client *client, xcb_button_press_event_t *event);
48 * Called when the user clicked on the titlebar of a floating window.
49 * Calls the drag_pointer function with the drag_window callback
52 void floating_drag_window(xcb_connection_t *conn, Client *client, xcb_button_press_event_t *event);
55 * Changes focus in the given direction for floating clients.
57 * Changing to the left/right means going to the previous/next floating client,
58 * changing to top/bottom means cycling through the Z-index.
61 void floating_focus_direction(xcb_connection_t *conn, Client *currently_focused, direction_t direction);
64 * Moves the client 10px to the specified direction.
67 void floating_move(xcb_connection_t *conn, Client *currently_focused, direction_t direction);
70 * Hides all floating clients (or show them if they are currently hidden) on
71 * the specified workspace.
74 void floating_toggle_hide(xcb_connection_t *conn, Workspace *workspace);
77 * This function grabs your pointer and lets you drag stuff around (borders).
78 * Every time you move your mouse, an XCB_MOTION_NOTIFY event will be received
79 * and the given callback will be called with the parameters specified (client,
80 * border on which the click originally was), the original rect of the client,
81 * the event and the new coordinates (x, y).
84 void drag_pointer(xcb_connection_t *conn, Client *client, xcb_button_press_event_t *event,
85 xcb_window_t confine_to, border_t border, callback_t callback);