Merge pull request #2102 from ccryx/next

Add support for _NET_WM_WINDOW_TYPE_NOTIFICATION
This commit is contained in:
Michael Stapelberg 2015-12-16 08:58:59 +01:00
commit af49a8cd0d
6 changed files with 10 additions and 4 deletions

View File

@ -1657,7 +1657,7 @@ window_role::
window_type:: window_type::
Compare the window type (_NET_WM_WINDOW_TYPE). Possible values are Compare the window type (_NET_WM_WINDOW_TYPE). Possible values are
+normal+, +dialog+, +utility+, +toolbar+, +splash+, +menu+, +dropdown_menu+, +normal+, +dialog+, +utility+, +toolbar+, +splash+, +menu+, +dropdown_menu+,
+popup_menu+ and +tooltip+. +popup_menu+, +tooltip+ and +notification+.
id:: id::
Compares the X11 window ID, which you can get via +xwininfo+ for example. Compares the X11 window ID, which you can get via +xwininfo+ for example.
title:: title::

View File

@ -20,6 +20,7 @@ xmacro(_NET_WM_WINDOW_TYPE_MENU)
xmacro(_NET_WM_WINDOW_TYPE_DROPDOWN_MENU) xmacro(_NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
xmacro(_NET_WM_WINDOW_TYPE_POPUP_MENU) xmacro(_NET_WM_WINDOW_TYPE_POPUP_MENU)
xmacro(_NET_WM_WINDOW_TYPE_TOOLTIP) xmacro(_NET_WM_WINDOW_TYPE_TOOLTIP)
xmacro(_NET_WM_WINDOW_TYPE_NOTIFICATION)
xmacro(_NET_WM_DESKTOP) xmacro(_NET_WM_DESKTOP)
xmacro(_NET_WM_STRUT_PARTIAL) xmacro(_NET_WM_STRUT_PARTIAL)
xmacro(_NET_CLIENT_LIST) xmacro(_NET_CLIENT_LIST)

View File

@ -330,6 +330,8 @@ void match_parse_property(Match *match, const char *ctype, const char *cvalue) {
match->window_type = A__NET_WM_WINDOW_TYPE_POPUP_MENU; match->window_type = A__NET_WM_WINDOW_TYPE_POPUP_MENU;
} else if (strcasecmp(cvalue, "tooltip") == 0) { } else if (strcasecmp(cvalue, "tooltip") == 0) {
match->window_type = A__NET_WM_WINDOW_TYPE_TOOLTIP; match->window_type = A__NET_WM_WINDOW_TYPE_TOOLTIP;
} else if (strcasecmp(cvalue, "notification") == 0) {
match->window_type = A__NET_WM_WINDOW_TYPE_NOTIFICATION;
} else { } else {
ELOG("unknown window_type value \"%s\"\n", cvalue); ELOG("unknown window_type value \"%s\"\n", cvalue);
match->error = sstrdup("unknown window_type value"); match->error = sstrdup("unknown window_type value");

View File

@ -175,7 +175,8 @@ xcb_atom_t xcb_get_preferred_window_type(xcb_get_property_reply_t *reply) {
atoms[i] == A__NET_WM_WINDOW_TYPE_MENU || atoms[i] == A__NET_WM_WINDOW_TYPE_MENU ||
atoms[i] == A__NET_WM_WINDOW_TYPE_DROPDOWN_MENU || atoms[i] == A__NET_WM_WINDOW_TYPE_DROPDOWN_MENU ||
atoms[i] == A__NET_WM_WINDOW_TYPE_POPUP_MENU || atoms[i] == A__NET_WM_WINDOW_TYPE_POPUP_MENU ||
atoms[i] == A__NET_WM_WINDOW_TYPE_TOOLTIP) { atoms[i] == A__NET_WM_WINDOW_TYPE_TOOLTIP ||
atoms[i] == A__NET_WM_WINDOW_TYPE_NOTIFICATION) {
return atoms[i]; return atoms[i];
} }
} }

View File

@ -380,7 +380,8 @@ my %window_types = (
'menu' => '_NET_WM_WINDOW_TYPE_MENU', 'menu' => '_NET_WM_WINDOW_TYPE_MENU',
'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_MENU', 'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_MENU',
'popup_menu' => '_NET_WM_WINDOW_TYPE_POPUP_MENU', 'popup_menu' => '_NET_WM_WINDOW_TYPE_POPUP_MENU',
'tooltip' => '_NET_WM_WINDOW_TYPE_TOOLTIP' 'tooltip' => '_NET_WM_WINDOW_TYPE_TOOLTIP',
'notification' => '_NET_WM_WINDOW_TYPE_NOTIFICATION'
); );
while (my ($window_type, $atom) = each %window_types) { while (my ($window_type, $atom) = each %window_types) {

View File

@ -54,7 +54,8 @@ my %window_types = (
'menu' => '_NET_WM_WINDOW_TYPE_MENU', 'menu' => '_NET_WM_WINDOW_TYPE_MENU',
'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_MENU', 'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_MENU',
'popup_menu' => '_NET_WM_WINDOW_TYPE_POPUP_MENU', 'popup_menu' => '_NET_WM_WINDOW_TYPE_POPUP_MENU',
'tooltip' => '_NET_WM_WINDOW_TYPE_TOOLTIP' 'tooltip' => '_NET_WM_WINDOW_TYPE_TOOLTIP',
'notification' => '_NET_WM_WINDOW_TYPE_NOTIFICATION'
); );
while (my ($window_type, $atom) = each %window_types) { while (my ($window_type, $atom) = each %window_types) {