Support matching _NET_WM_WINDOW_TYPE_NOTIFICATION
This commit fixes #1969 by adding support for matching a window's type against _NET_WM_WINDOW_TYPE_NOTIFICATION. The userguide and tests were updated to reflect this change.
This commit is contained in:
parent
954927ccc4
commit
33f017daa9
|
@ -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::
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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");
|
||||||
|
|
|
@ -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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue