i3 - improved tiling WM


Bugfix: _NET_SUPPORTED property fixes

Patch status: rejected

Patch by Tony Crisci

Long description:

Fix a typing mistake that may cause _NET_SUPPORTED root property to
become corrupted.

This bug was introduced in:

Implement EWMH number of desktops property

http://code.stapelberg.de/git/i3/commit/?h=next&id=b47f480728a6d053c117e4b99ee4c78d99ba6a71

Dynamically set the size of this property based on the number of atoms.
This adds several new atoms to the property, and avoids the need to
increment this number when new atoms are added to avoid such mistakes in
the future.

fixes #1298

To apply this patch, use:
curl http://cr.i3wm.org/patch/611/raw.patch | git am

b/src/ewmh.c

28
@@ -229,10 +229,11 @@ void ewmh_setup_hints(void) {
29
         NULL);
30
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, child_window, A__NET_SUPPORTING_WM_CHECK, XCB_ATOM_WINDOW, 32, 1, &child_window);
31
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, child_window, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen("i3"), "i3");
32
-    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTING_WM_CHECK, XCB_ATOM_WINDOW, 33, 1, &child_window);
33
+    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTING_WM_CHECK, XCB_ATOM_WINDOW, 32, 1, &child_window);
34
 
35
     /* I’m not entirely sure if we need to keep _NET_WM_NAME on root. */
36
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen("i3"), "i3");
37
 
38
-    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTED, XCB_ATOM_ATOM, 32, 21, supported_atoms);
39
+    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTED, XCB_ATOM_ATOM, 32,
40
+            sizeof(supported_atoms) / sizeof(xcb_atom_t), supported_atoms);
41
 }