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

@ -632,6 +632,7 @@ void parse_file(const char *f) {
%token TOK_MARK "mark"
%token TOK_CLASS "class"
%token TOK_INSTANCE "instance"
%token TOK_WINDOW_ROLE "window_role"
%token TOK_ID "id"
%token TOK_CON_ID "con_id"
%token TOK_TITLE "title"
@ -792,6 +793,12 @@ criterion:
current_match.instance = regex_new($3);
free($3);
}
| TOK_WINDOW_ROLE '=' STR
{
printf("criteria: window_role = %s\n", $3);
current_match.role = regex_new($3);
free($3);
}
| TOK_CON_ID '=' STR
{
printf("criteria: id = %s\n", $3);