]> git.sur5r.net Git - i3/i3/commitdiff
Update _NET_WM_STATE after fullscreen state changes
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 26 May 2010 21:21:37 +0000 (23:21 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 26 May 2010 21:21:37 +0000 (23:21 +0200)
src/con.c

index 83e89631db83bd375032102e13dc2d2f2920a362..36070849365b5a677252ac5a8afaf372e78daf8b 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -289,4 +289,19 @@ void con_toggle_fullscreen(Con *con) {
         con->fullscreen_mode = CF_NONE;
     }
     LOG("mode now: %d\n", con->fullscreen_mode);
+
+    /* update _NET_WM_STATE if this container has a window */
+    /* TODO: when a window is assigned to a container which is already
+     * fullscreened, this state needs to be pushed to the client, too */
+    if (con->window == NULL)
+        return;
+
+    uint32_t values[1];
+    unsigned int num = 0;
+
+    if (con->fullscreen_mode != CF_NONE)
+        values[num++] = atoms[_NET_WM_STATE_FULLSCREEN];
+
+    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, con->window->id,
+                        atoms[_NET_WM_STATE], ATOM, 32, num, values);
 }