2009-05-16 11:32:36 -04:00
|
|
|
|
/*
|
|
|
|
|
* vim:ts=8:expandtab
|
|
|
|
|
*
|
|
|
|
|
* i3 - an improved dynamic tiling window manager
|
|
|
|
|
*
|
2009-12-22 17:40:06 -05:00
|
|
|
|
* © 2009 Michael Stapelberg and contributors
|
2009-05-16 11:32:36 -04:00
|
|
|
|
*
|
|
|
|
|
* See file LICENSE for license information.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
#include <xcb/xcb.h>
|
|
|
|
|
|
|
|
|
|
#include "data.h"
|
|
|
|
|
|
|
|
|
|
#ifndef _CLIENT_H
|
|
|
|
|
#define _CLIENT_H
|
|
|
|
|
|
|
|
|
|
/**
|
2009-06-29 15:54:51 -04:00
|
|
|
|
* Removes the given client from the container, either because it will be
|
|
|
|
|
* inserted into another one or because it was unmapped
|
2009-05-16 11:32:36 -04:00
|
|
|
|
*
|
|
|
|
|
*/
|
2009-06-29 15:54:51 -04:00
|
|
|
|
void client_remove_from_container(xcb_connection_t *conn, Client *client,
|
|
|
|
|
Container *container,
|
|
|
|
|
bool remove_from_focusstack);
|
2009-05-16 11:32:36 -04:00
|
|
|
|
|
|
|
|
|
/**
|
2009-06-29 15:54:51 -04:00
|
|
|
|
* Warps the pointer into the given client (in the middle of it, to be
|
|
|
|
|
* specific), therefore selecting it
|
2009-05-16 11:32:36 -04:00
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_warp_pointer_into(xcb_connection_t *conn, Client *client);
|
|
|
|
|
|
2011-03-18 12:26:19 -04:00
|
|
|
|
/**
|
|
|
|
|
* Returns true if the client supports the given protocol atom (like WM_DELETE_WINDOW)
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
bool client_supports_protocol(xcb_connection_t *conn, Client *client, xcb_atom_t atom);
|
|
|
|
|
|
2009-05-16 11:32:36 -04:00
|
|
|
|
/**
|
|
|
|
|
* Kills the given window using WM_DELETE_WINDOW or xcb_kill_window
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_kill(xcb_connection_t *conn, Client *window);
|
|
|
|
|
|
|
|
|
|
/**
|
2009-06-29 15:54:51 -04:00
|
|
|
|
* Checks if the given window class and title match the given client Window
|
|
|
|
|
* title is passed as "normal" string and as UCS-2 converted string for
|
2009-05-16 11:32:36 -04:00
|
|
|
|
* matching _NET_WM_NAME capable clients as well as those using legacy hints.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
bool client_matches_class_name(Client *client, char *to_class, char *to_title,
|
|
|
|
|
char *to_title_ucs, int to_title_ucs_len);
|
|
|
|
|
|
2009-06-25 07:46:47 -04:00
|
|
|
|
/**
|
|
|
|
|
* Enters fullscreen mode for the given client. This is called by toggle_fullscreen
|
|
|
|
|
* and when moving a fullscreen client to another screen.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2010-03-07 20:02:35 -05:00
|
|
|
|
void client_enter_fullscreen(xcb_connection_t *conn, Client *client, bool global);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Leaves fullscreen mode for the given client. This is called by toggle_fullscreen.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_leave_fullscreen(xcb_connection_t *conn, Client *client);
|
2009-06-25 07:46:47 -04:00
|
|
|
|
|
2010-03-20 09:47:33 -04:00
|
|
|
|
/**
|
|
|
|
|
* Leaves fullscreen mode for the current client. This is called by toggle_fullscreen.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_leave_fullscreen(xcb_connection_t *conn, Client *client);
|
|
|
|
|
|
2009-05-26 10:49:57 -04:00
|
|
|
|
/**
|
2009-06-29 15:54:51 -04:00
|
|
|
|
* Toggles fullscreen mode for the given client. It updates the data
|
|
|
|
|
* structures and reconfigures (= resizes/moves) the client and its frame to
|
|
|
|
|
* the full size of the screen. When leaving fullscreen, re-rendering the
|
|
|
|
|
* layout is forced.
|
2009-05-26 10:49:57 -04:00
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_toggle_fullscreen(xcb_connection_t *conn, Client *client);
|
|
|
|
|
|
2010-03-07 20:02:35 -05:00
|
|
|
|
/**
|
|
|
|
|
* Like client_toggle_fullscreen(), but putting it in global fullscreen-mode.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_toggle_fullscreen_global(xcb_connection_t *conn, Client *client);
|
|
|
|
|
|
2009-06-19 17:18:43 -04:00
|
|
|
|
/**
|
2009-06-29 15:54:51 -04:00
|
|
|
|
* Sets the position of the given client in the X stack to the highest (tiling
|
|
|
|
|
* layer is always on the same position, so this doesn’t matter) below the
|
|
|
|
|
* first floating client, so that floating windows are always on top.
|
2009-06-19 17:18:43 -04:00
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_set_below_floating(xcb_connection_t *conn, Client *client);
|
|
|
|
|
|
2009-06-21 10:14:15 -04:00
|
|
|
|
/**
|
2009-06-29 15:54:51 -04:00
|
|
|
|
* Returns true if the client is floating. Makes the code more beatiful, as
|
|
|
|
|
* floating is not simply a boolean, but also saves whether the user selected
|
|
|
|
|
* the current state or whether it was automatically set.
|
2009-06-21 10:14:15 -04:00
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
bool client_is_floating(Client *client);
|
|
|
|
|
|
2009-08-05 12:33:44 -04:00
|
|
|
|
/**
|
|
|
|
|
* Change the border type for the given client to normal (n), 1px border (p) or
|
|
|
|
|
* completely borderless (b).
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_change_border(xcb_connection_t *conn, Client *client, char border_type);
|
|
|
|
|
|
2009-11-08 06:43:01 -05:00
|
|
|
|
/**
|
|
|
|
|
* Change the border type for the given client to normal (n), 1px border (p) or
|
|
|
|
|
* completely borderless (b) without actually re-rendering the layout. Useful
|
|
|
|
|
* for calling it when initializing a new client.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
bool client_init_border(xcb_connection_t *conn, Client *client, char border_type);
|
|
|
|
|
|
2009-08-11 06:16:10 -04:00
|
|
|
|
/**
|
|
|
|
|
* Unmap the client, correctly setting any state which is needed.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_unmap(xcb_connection_t *conn, Client *client);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Map the client, correctly restoring any state needed.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_map(xcb_connection_t *conn, Client *client);
|
|
|
|
|
|
2009-09-20 10:54:29 -04:00
|
|
|
|
/**
|
|
|
|
|
* Set the given mark for this client. Used for jumping to the client
|
|
|
|
|
* afterwards (like m<mark> and '<mark> in vim).
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
void client_mark(xcb_connection_t *conn, Client *client, const char *mark);
|
|
|
|
|
|
2009-12-12 16:27:57 -05:00
|
|
|
|
/**
|
|
|
|
|
* Returns the minimum height of a specific window. The height is calculated
|
|
|
|
|
* by using 2 pixels (for the client window itself), possibly padding this to
|
|
|
|
|
* comply with the client’s base_height and then adding the decoration height.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
uint32_t client_min_height(Client *client);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* See client_min_height.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
uint32_t client_min_width(Client *client);
|
|
|
|
|
|
2009-08-11 09:02:30 -04:00
|
|
|
|
/**
|
|
|
|
|
* Pretty-prints the client’s information into the logfile.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2009-08-11 09:23:58 -04:00
|
|
|
|
#define CLIENT_LOG(client) do { \
|
2009-12-19 16:39:00 -05:00
|
|
|
|
DLOG("Window: frame 0x%08x, child 0x%08x\n", client->frame, client->child); \
|
2009-08-11 09:23:58 -04:00
|
|
|
|
} while (0)
|
2009-08-11 09:02:30 -04:00
|
|
|
|
|
2009-05-16 11:32:36 -04:00
|
|
|
|
#endif
|