Implement new criterion 'window_type = normal|dialog|utility|toolbar|splash|menu|dropdown_menu|popup_menu|tooltip'

fixes #1658
This commit is contained in:
Ingo Bürk
2015-04-18 21:09:03 +02:00
parent 7e424b2d71
commit 550c0ec318
13 changed files with 142 additions and 24 deletions

View File

@ -363,6 +363,31 @@ void cmd_criteria_add(I3_CMD, char *ctype, char *cvalue) {
return;
}
if (strcmp(ctype, "window_type") == 0) {
if (strcasecmp(cvalue, "normal") == 0)
current_match->window_type = A__NET_WM_WINDOW_TYPE_NORMAL;
else if (strcasecmp(cvalue, "dialog") == 0)
current_match->window_type = A__NET_WM_WINDOW_TYPE_DIALOG;
else if (strcasecmp(cvalue, "utility") == 0)
current_match->window_type = A__NET_WM_WINDOW_TYPE_UTILITY;
else if (strcasecmp(cvalue, "toolbar") == 0)
current_match->window_type = A__NET_WM_WINDOW_TYPE_TOOLBAR;
else if (strcasecmp(cvalue, "splash") == 0)
current_match->window_type = A__NET_WM_WINDOW_TYPE_SPLASH;
else if (strcasecmp(cvalue, "menu") == 0)
current_match->window_type = A__NET_WM_WINDOW_TYPE_MENU;
else if (strcasecmp(cvalue, "dropdown_menu") == 0)
current_match->window_type = A__NET_WM_WINDOW_TYPE_DROPDOWN_MENU;
else if (strcasecmp(cvalue, "popup_menu") == 0)
current_match->window_type = A__NET_WM_WINDOW_TYPE_POPUP_MENU;
else if (strcasecmp(cvalue, "tooltip") == 0)
current_match->window_type = A__NET_WM_WINDOW_TYPE_TOOLTIP;
else
ELOG("unknown window_type value \"%s\"\n", cvalue);
return;
}
if (strcmp(ctype, "con_mark") == 0) {
current_match->mark = regex_new(cvalue);
return;