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:
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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 workspace’s
|
||||
* urgent flag accordingly.
|
||||
*
|
||||
*/
|
||||
void workspace_update_urgent_flag(Workspace *ws);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user