]> git.sur5r.net Git - i3/i3/blob - include/x.h
Merge pull request #1636 from Deiz/update-notices
[i3/i3] / include / x.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * x.c: Interface to X11, transfers our in-memory state to X11 (see also
8  *      render.c). Basically a big state machine.
9  *
10  */
11 #pragma once
12
13 /** Stores the X11 window ID of the currently focused window */
14 extern xcb_window_t focused_id;
15
16 /**
17  * Initializes the X11 part for the given container. Called exactly once for
18  * every container from con_new().
19  *
20  */
21 void x_con_init(Con *con, uint16_t depth);
22
23 /**
24  * Moves a child window from Container src to Container dest.
25  *
26  */
27 void x_move_win(Con *src, Con *dest);
28
29 /**
30  * Reparents the child window of the given container (necessary for sticky
31  * containers). The reparenting happens in the next call of x_push_changes().
32  *
33  */
34 void x_reparent_child(Con *con, Con *old);
35
36 /**
37  * Re-initializes the associated X window state for this container. You have
38  * to call this when you assign a client to an empty container to ensure that
39  * its state gets updated correctly.
40  *
41  */
42 void x_reinit(Con *con);
43
44 /**
45  * Kills the window decoration associated with the given container.
46  *
47  */
48 void x_con_kill(Con *con);
49
50 /**
51  * Returns true if the client supports the given protocol atom (like WM_DELETE_WINDOW)
52  *
53  */
54 bool window_supports_protocol(xcb_window_t window, xcb_atom_t atom);
55
56 /**
57  * Kills the given X11 window using WM_DELETE_WINDOW (if supported).
58  *
59  */
60 void x_window_kill(xcb_window_t window, kill_window_t kill_window);
61
62 /**
63  * Draws the decoration of the given container onto its parent.
64  *
65  */
66 void x_draw_decoration(Con *con);
67
68 /**
69  * Recursively calls x_draw_decoration. This cannot be done in x_push_node
70  * because x_push_node uses focus order to recurse (see the comment above)
71  * while drawing the decoration needs to happen in the actual order.
72  *
73  */
74 void x_deco_recurse(Con *con);
75
76 /**
77  * This function pushes the properties of each node of the layout tree to
78  * X11 if they have changed (like the map state, position of the window, …).
79  * It recursively traverses all children of the given node.
80  *
81  */
82 void x_push_node(Con *con);
83
84 /**
85  * Pushes all changes (state of each node, see x_push_node() and the window
86  * stack) to X11.
87  *
88  */
89 void x_push_changes(Con *con);
90
91 /**
92  * Raises the specified container in the internal stack of X windows. The
93  * next call to x_push_changes() will make the change visible in X11.
94  *
95  */
96 void x_raise_con(Con *con);
97
98 /**
99  * Sets the WM_NAME property (so, no UTF8, but used only for debugging anyways)
100  * of the given name. Used for properly tagging the windows for easily spotting
101  * i3 windows in xwininfo -root -all.
102  *
103  */
104 void x_set_name(Con *con, const char *name);
105
106 /**
107  * Set up the SHMLOG_PATH atom.
108  *
109  */
110 void update_shmlog_atom(void);
111
112 /**
113  * Sets up i3 specific atoms (I3_SOCKET_PATH and I3_CONFIG_PATH)
114  *
115  */
116 void x_set_i3_atoms(void);
117
118 /**
119  * Set warp_to coordinates.  This will trigger on the next call to
120  * x_push_changes().
121  *
122  */
123 void x_set_warp_to(Rect *rect);
124
125 /**
126  * Applies the given mask to the event mask of every i3 window decoration X11
127  * window. This is useful to disable EnterNotify while resizing so that focus
128  * is untouched.
129  *
130  */
131 void x_mask_event_mask(uint32_t mask);