Implement the urgency hint for windows/workspaces

Thanks to Mikael for bringing it to my mind. This change introduces
two new color classes, client.urgent and bar.urgent. By default,
urgent clients are drawn in red (colors by Atsutane).
This commit is contained in:
Michael Stapelberg
2009-09-06 22:40:11 +02:00
parent e893902585
commit 2ff2a6a315
11 changed files with 125 additions and 15 deletions

View File

@ -64,10 +64,12 @@ struct Config {
struct Colortriple focused;
struct Colortriple focused_inactive;
struct Colortriple unfocused;
struct Colortriple urgent;
} client;
struct config_bar {
struct Colortriple focused;
struct Colortriple unfocused;
struct Colortriple urgent;
} bar;
};

View File

@ -201,6 +201,9 @@ struct Workspace {
/** Temporary flag needed for re-querying xinerama screens */
bool reassigned;
/** True if any client on this workspace has its urgent flag set */
bool urgent;
/** the client who is started in fullscreen mode on this workspace,
* NULL if there is none */
Client *fullscreen_client;
@ -400,6 +403,9 @@ struct Client {
* the screen and its requested size is used */
bool dock;
/** True if the client set the urgency flag in its WM_HINTS property */
bool urgent;
/* After leaving fullscreen mode, a client needs to be reconfigured
* (configuration = setting X, Y, width and height). By setting the
* force_reconfigure flag, render_layout() will reconfigure the

View File

@ -160,6 +160,13 @@ int handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state,
xcb_window_t window, xcb_atom_t name,
xcb_get_property_reply_t *reply);
/**
* Handles the WM_HINTS property for extracting the urgency state of the window.
*
*/
int handle_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_window_t window,
xcb_atom_t name, xcb_get_property_reply_t *reply);
/**
* Handles the transient for hints set by a window, signalizing that this
* window is a popup window for some other window.

View File

@ -62,7 +62,17 @@ Workspace *get_first_workspace_for_screen(struct screens_head *slist, i3Screen *
*/
void workspace_unmap_clients(xcb_connection_t *conn, Workspace *u_ws);
/**
* Maps all clients (and stack windows) of the given workspace.
*
*/
void workspace_map_clients(xcb_connection_t *conn, Workspace *ws);
/**
* Goes through all clients on the given workspace and updates the workspaces
* urgent flag accordingly.
*
*/
void workspace_update_urgent_flag(Workspace *ws);
#endif