]> git.sur5r.net Git - i3/i3/commitdiff
Remove _NET_WM_STATE on withdrawn windows. 2196/head
authorIngo Bürk <ingo.buerk@tngtech.com>
Sun, 7 Feb 2016 11:08:50 +0000 (12:08 +0100)
committerIngo Bürk <ingo.buerk@tngtech.com>
Sun, 7 Feb 2016 11:08:50 +0000 (12:08 +0100)
According to the spec, _NET_WM_STATE must be removed when the window is
withdrawn, much like _NET_WM_DESKTOP.

fixes #2165

src/handlers.c
testcases/t/253-multiple-net-wm-state-atoms.t

index 7e116ce70fc64f8c28f18797bc71ce5cf38ae7d1..2991d7c39844c1961bde2c4cb1274ccf1db8ee06 100644 (file)
@@ -503,8 +503,10 @@ static void handle_unmap_notify_event(xcb_unmap_notify_event_t *event) {
         goto ignore_end;
     }
 
-    /* Since we close the container, we need to unset _NET_WM_DESKTOP according to the spec. */
+    /* Since we close the container, we need to unset _NET_WM_DESKTOP and
+     * _NET_WM_STATE according to the spec. */
     xcb_delete_property(conn, event->window, A__NET_WM_DESKTOP);
+    xcb_delete_property(conn, event->window, A__NET_WM_STATE);
 
     tree_close_internal(con, DONT_KILL_WINDOW, false, false);
     tree_render();
index bbd6c5214c5889ae2e2f9996a6652b868b229328..bfa8b46cba25a66d8cba8981d5cbfe882823a7af 100644 (file)
@@ -33,7 +33,7 @@ sub get_wm_state {
 
     my $reply = $x->get_property_reply($cookie->{sequence});
     my $len = $reply->{length};
-    return 0 if $len == 0;
+    return undef if $len == 0;
 
     my @atoms = unpack("L$len", $reply->{value});
     return \@atoms;
@@ -64,6 +64,20 @@ cmd 'sticky enable';
 cmd 'fullscreen disable';
 is_deeply(get_wm_state($window), [ $wm_state_sticky ], 'only _NET_WM_STATE_STICKY is set');
 
+###############################################################################
+# _NET_WM_STATE is removed when the window is withdrawn.
+###############################################################################
+
+fresh_workspace;
+$window = open_window;
+cmd 'sticky enable';
+is_deeply(get_wm_state($window), [ $wm_state_sticky ], 'sanity check: _NET_WM_STATE_STICKY is set');
+
+$window->unmap;
+wait_for_unmap($window);
+
+is(get_wm_state($window), undef, '_NET_WM_STATE is removed');
+
 ##########################################################################
 
 done_testing;