]> git.sur5r.net Git - i3/i3/commitdiff
Support matching _NET_WM_WINDOW_TYPE_NOTIFICATION 2102/head
authorFlorian Merkel <florian.merkel@uni-oldenburg.de>
Mon, 7 Dec 2015 11:34:24 +0000 (12:34 +0100)
committerFlorian Merkel <florian.merkel@uni-oldenburg.de>
Tue, 15 Dec 2015 20:55:33 +0000 (21:55 +0100)
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.

docs/userguide
include/atoms.xmacro
src/match.c
src/xcb.c
testcases/t/165-for_window.t
testcases/t/232-cmd-move-criteria.t

index e596aeae08c82d71af985d1b35a5d3aaa7e8d764..69f7da9225d7a85427a3062850562499bc12d022 100644 (file)
@@ -1657,7 +1657,7 @@ window_role::
 window_type::
        Compare the window type (_NET_WM_WINDOW_TYPE). Possible values are
        +normal+, +dialog+, +utility+, +toolbar+, +splash+, +menu+, +dropdown_menu+,
-       +popup_menu+ and +tooltip+.
+       +popup_menu+, +tooltip+ and +notification+.
 id::
        Compares the X11 window ID, which you can get via +xwininfo+ for example.
 title::
index 8798528ab0bcd0a5f020f6b8d4e60aea2dc5f900..139b6efb4530564d77fda464c4b8a5e1798752a3 100644 (file)
@@ -20,6 +20,7 @@ xmacro(_NET_WM_WINDOW_TYPE_MENU)
 xmacro(_NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
 xmacro(_NET_WM_WINDOW_TYPE_POPUP_MENU)
 xmacro(_NET_WM_WINDOW_TYPE_TOOLTIP)
+xmacro(_NET_WM_WINDOW_TYPE_NOTIFICATION)
 xmacro(_NET_WM_DESKTOP)
 xmacro(_NET_WM_STRUT_PARTIAL)
 xmacro(_NET_CLIENT_LIST)
index caeb909fce43bfa0cbb129b62535ff505039b769..bbb239ac7d0a2ae7119c617d733636de2dafed4b 100644 (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;
         } else if (strcasecmp(cvalue, "tooltip") == 0) {
             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 {
             ELOG("unknown window_type value \"%s\"\n", cvalue);
             match->error = sstrdup("unknown window_type value");
index 07f9281a58dba2f5284c58fe1aa256f8acf67eae..9d181cfa8c8ba28dbb4b5a35e14aca1c2ec2ce4d 100644 (file)
--- a/src/xcb.c
+++ b/src/xcb.c
@@ -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_DROPDOWN_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];
         }
     }
index 476bcc9f9caf47e59f1d6f61fa3e741e0a062ce1..025fe21cc9fe1d7630af45c4e9eab2abc56a173f 100644 (file)
@@ -380,7 +380,8 @@ my %window_types = (
     'menu'          => '_NET_WM_WINDOW_TYPE_MENU',
     'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_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) {
index c023bca479dd15e19e5247c56ccf39ae63a9f84c..787f72b3285fc4cc4915ce487bc3db7e9ac34a8d 100644 (file)
@@ -54,7 +54,8 @@ my %window_types = (
     'menu'          => '_NET_WM_WINDOW_TYPE_MENU',
     'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_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) {