4 * i3 - an improved dynamic tiling window manager
6 * © 2009-2010 Michael Stapelberg and contributors
8 * See file LICENSE for license information.
16 /** Callback for dragging */
17 typedef void(*callback_t)(Con*, Rect*, uint32_t, uint32_t, void*);
19 /** Macro to create a callback function for dragging */
20 #define DRAGGING_CB(name) \
21 static void name(Con *con, Rect *old_rect, uint32_t new_x, \
22 uint32_t new_y, void *extra)
24 /** On which border was the dragging initiated? */
25 typedef enum { BORDER_LEFT = (1 << 0),
26 BORDER_RIGHT = (1 << 1),
27 BORDER_TOP = (1 << 2),
28 BORDER_BOTTOM = (1 << 3)} border_t;
31 * Enters floating mode for the given client. Correctly takes care of the
32 * position/size (separately stored for tiling/floating mode) and
33 * repositions/resizes/redecorates the client.
35 * If the automatic flag is set to true, this was an automatic update by a
36 * change of the window class from the application which can be overwritten by
40 void toggle_floating_mode(Con *con, bool automatic);
44 * Removes the floating client from its workspace and attaches it to the new
45 * workspace. This is centralized here because it may happen if you move it
46 * via keyboard and if you move it using your mouse.
49 void floating_assign_to_workspace(Client *client, Workspace *new_workspace);
52 * Called whenever the user clicks on a border (not the titlebar!) of a
53 * floating window. Determines on which border the user clicked and launches
54 * the drag_pointer function with the resize_callback.
57 int floating_border_click(xcb_connection_t *conn, Client *client,
58 xcb_button_press_event_t *event);
62 * Called when the user clicked on the titlebar of a floating window.
63 * Calls the drag_pointer function with the drag_window callback
66 void floating_drag_window(Con *con, xcb_button_press_event_t *event);
70 * Called when the user clicked on a floating window while holding the
71 * floating_modifier and the right mouse button.
72 * Calls the drag_pointer function with the resize_window callback
75 void floating_resize_window(xcb_connection_t *conn, Client *client,
76 bool proportional, xcb_button_press_event_t *event);
79 * Changes focus in the given direction for floating clients.
81 * Changing to the left/right means going to the previous/next floating client,
82 * changing to top/bottom means cycling through the Z-index.
85 void floating_focus_direction(xcb_connection_t *conn, Client *currently_focused,
86 direction_t direction);
89 * Moves the client 10px to the specified direction.
92 void floating_move(xcb_connection_t *conn, Client *currently_focused,
93 direction_t direction);
96 * Hides all floating clients (or show them if they are currently hidden) on
97 * the specified workspace.
100 void floating_toggle_hide(xcb_connection_t *conn, Workspace *workspace);
104 * This function grabs your pointer and lets you drag stuff around (borders).
105 * Every time you move your mouse, an XCB_MOTION_NOTIFY event will be received
106 * and the given callback will be called with the parameters specified (client,
107 * border on which the click originally was), the original rect of the client,
108 * the event and the new coordinates (x, y).
111 void drag_pointer(Con *con, xcb_button_press_event_t *event,
112 xcb_window_t confine_to, border_t border, callback_t callback,