Implement the window_role criterion (checks WM_WINDOW_ROLE)

Closes: #446

This is handy for matching specific windows of a multi-window application, for
example only Pidgin’s buddy list window.
This commit is contained in:
Michael Stapelberg
2011-09-18 16:05:10 +01:00
parent 99168a84a9
commit b3adaa2983
11 changed files with 98 additions and 2 deletions

View File

@ -21,5 +21,6 @@ xmacro(UTF8_STRING)
xmacro(WM_STATE)
xmacro(WM_CLIENT_LEADER)
xmacro(WM_TAKE_FOCUS)
xmacro(WM_WINDOW_ROLE)
xmacro(I3_SOCKET_PATH)
xmacro(I3_CONFIG_PATH)

View File

@ -264,6 +264,11 @@ struct Window {
* application supports _NET_WM_NAME, in COMPOUND_TEXT otherwise). */
char *name_x;
/** The WM_WINDOW_ROLE of this window (for example, the pidgin buddy window
* sets "buddy list"). Useful to match specific windows in assignments or
* for_window. */
char *role;
/** Flag to force re-rendering the decoration upon changes */
bool name_x_changed;
@ -298,6 +303,7 @@ struct Match {
struct regex *class;
struct regex *instance;
struct regex *mark;
struct regex *role;
enum {
M_DONTCHECK = -1,
M_NODOCK = 0,

View File

@ -42,4 +42,10 @@ void window_update_transient_for(i3Window *win, xcb_get_property_reply_t *prop);
*/
void window_update_strut_partial(i3Window *win, xcb_get_property_reply_t *prop);
/**
* Updates the WM_WINDOW_ROLE
*
*/
void window_update_role(i3Window *win, xcb_get_property_reply_t *prop, bool before_mgmt);
#endif