2010-03-27 15:25:51 +01:00
|
|
|
/*
|
|
|
|
* vim:ts=4:sw=4:expandtab
|
2011-10-25 22:19:38 +02:00
|
|
|
*
|
|
|
|
* i3 - an improved dynamic tiling window manager
|
2015-04-04 02:17:56 +02:00
|
|
|
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
2011-10-25 22:19:38 +02:00
|
|
|
*
|
|
|
|
* x.c: Interface to X11, transfers our in-memory state to X11 (see also
|
|
|
|
* render.c). Basically a big state machine.
|
|
|
|
*
|
2010-03-27 15:25:51 +01:00
|
|
|
*/
|
2013-12-29 03:11:50 +01:00
|
|
|
#pragma once
|
2010-03-27 15:25:51 +01:00
|
|
|
|
2016-10-11 09:13:35 +02:00
|
|
|
#include <config.h>
|
|
|
|
|
2011-03-20 16:26:36 +01:00
|
|
|
/** Stores the X11 window ID of the currently focused window */
|
|
|
|
extern xcb_window_t focused_id;
|
|
|
|
|
2010-07-13 11:35:05 +02:00
|
|
|
/**
|
|
|
|
* Initializes the X11 part for the given container. Called exactly once for
|
|
|
|
* every container from con_new().
|
|
|
|
*
|
|
|
|
*/
|
2016-05-05 14:18:27 +02:00
|
|
|
void x_con_init(Con *con);
|
2010-07-13 11:35:05 +02:00
|
|
|
|
2010-09-01 18:11:01 +02:00
|
|
|
/**
|
|
|
|
* Moves a child window from Container src to Container dest.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void x_move_win(Con *src, Con *dest);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reparents the child window of the given container (necessary for sticky
|
|
|
|
* containers). The reparenting happens in the next call of x_push_changes().
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void x_reparent_child(Con *con, Con *old);
|
|
|
|
|
2010-07-13 11:35:05 +02:00
|
|
|
/**
|
|
|
|
* Re-initializes the associated X window state for this container. You have
|
|
|
|
* to call this when you assign a client to an empty container to ensure that
|
|
|
|
* its state gets updated correctly.
|
|
|
|
*
|
|
|
|
*/
|
2010-04-17 16:41:20 +02:00
|
|
|
void x_reinit(Con *con);
|
2010-07-13 11:35:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Kills the window decoration associated with the given container.
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 15:25:51 +01:00
|
|
|
void x_con_kill(Con *con);
|
2010-07-13 11:35:05 +02:00
|
|
|
|
2018-06-01 17:55:35 +02:00
|
|
|
/*
|
|
|
|
* Completely reinitializes the container's frame, without destroying the old window.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void x_con_reframe(Con *con);
|
|
|
|
|
2011-03-18 17:07:56 +01:00
|
|
|
/**
|
|
|
|
* Returns true if the client supports the given protocol atom (like WM_DELETE_WINDOW)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool window_supports_protocol(xcb_window_t window, xcb_atom_t atom);
|
|
|
|
|
2010-07-13 11:35:05 +02:00
|
|
|
/**
|
|
|
|
* Kills the given X11 window using WM_DELETE_WINDOW (if supported).
|
|
|
|
*
|
|
|
|
*/
|
2011-05-13 20:41:03 +02:00
|
|
|
void x_window_kill(xcb_window_t window, kill_window_t kill_window);
|
2010-07-13 11:35:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Draws the decoration of the given container onto its parent.
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 15:25:51 +01:00
|
|
|
void x_draw_decoration(Con *con);
|
2010-07-13 11:35:05 +02:00
|
|
|
|
2011-07-10 22:06:16 +02:00
|
|
|
/**
|
|
|
|
* Recursively calls x_draw_decoration. This cannot be done in x_push_node
|
|
|
|
* because x_push_node uses focus order to recurse (see the comment above)
|
|
|
|
* while drawing the decoration needs to happen in the actual order.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void x_deco_recurse(Con *con);
|
|
|
|
|
2011-04-01 22:40:12 +02:00
|
|
|
/**
|
|
|
|
* This function pushes the properties of each node of the layout tree to
|
|
|
|
* X11 if they have changed (like the map state, position of the window, …).
|
|
|
|
* It recursively traverses all children of the given node.
|
|
|
|
*
|
|
|
|
*/
|
2011-05-01 18:48:30 +02:00
|
|
|
void x_push_node(Con *con);
|
2011-04-01 22:40:12 +02:00
|
|
|
|
2010-07-13 11:35:05 +02:00
|
|
|
/**
|
|
|
|
* Pushes all changes (state of each node, see x_push_node() and the window
|
|
|
|
* stack) to X11.
|
|
|
|
*
|
|
|
|
*/
|
2010-03-27 15:25:51 +01:00
|
|
|
void x_push_changes(Con *con);
|
2010-07-13 11:35:05 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Raises the specified container in the internal stack of X windows. The
|
|
|
|
* next call to x_push_changes() will make the change visible in X11.
|
|
|
|
*
|
|
|
|
*/
|
2013-08-27 20:21:11 +02:00
|
|
|
void x_raise_con(Con *con);
|
2010-03-27 15:25:51 +01:00
|
|
|
|
2010-11-14 16:41:46 +01:00
|
|
|
/**
|
|
|
|
* Sets the WM_NAME property (so, no UTF8, but used only for debugging anyways)
|
|
|
|
* of the given name. Used for properly tagging the windows for easily spotting
|
|
|
|
* i3 windows in xwininfo -root -all.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void x_set_name(Con *con, const char *name);
|
|
|
|
|
2013-06-05 15:04:57 +02:00
|
|
|
/**
|
|
|
|
* Set up the SHMLOG_PATH atom.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void update_shmlog_atom(void);
|
|
|
|
|
2011-03-19 22:26:15 +01:00
|
|
|
/**
|
|
|
|
* Sets up i3 specific atoms (I3_SOCKET_PATH and I3_CONFIG_PATH)
|
|
|
|
*
|
|
|
|
*/
|
2012-03-31 10:53:04 +02:00
|
|
|
void x_set_i3_atoms(void);
|
2011-03-19 22:26:15 +01:00
|
|
|
|
2011-08-12 03:54:59 +02:00
|
|
|
/**
|
|
|
|
* Set warp_to coordinates. This will trigger on the next call to
|
|
|
|
* x_push_changes().
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void x_set_warp_to(Rect *rect);
|
|
|
|
|
2011-12-17 19:47:29 +01:00
|
|
|
/**
|
|
|
|
* Applies the given mask to the event mask of every i3 window decoration X11
|
|
|
|
* window. This is useful to disable EnterNotify while resizing so that focus
|
|
|
|
* is untouched.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void x_mask_event_mask(uint32_t mask);
|
2018-11-09 00:19:08 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Enables or disables nonrectangular shape of the container frame.
|
|
|
|
*/
|
|
|
|
void x_set_shape(Con *con, xcb_shape_sk_t kind, bool enable);
|