]> git.sur5r.net Git - i3/i3/blobdiff - src/ewmh.c
i3-nagbar: explicitly set cursor using libxcursor if available
[i3/i3] / src / ewmh.c
index eb6a6ea60d39af252364885f87f9b0f695ecb9ba..a5c90175495942b7460169afc645575ba2867fb1 100644 (file)
@@ -218,13 +218,13 @@ void ewmh_update_client_list_stacking(xcb_window_t *stack, int num_windows) {
  *
  */
 void ewmh_update_sticky(xcb_window_t window, bool sticky) {
-    uint32_t values[1];
-    unsigned int num = 0;
-
-    if (sticky)
-        values[num++] = A__NET_WM_STATE_STICKY;
-
-    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, window, A__NET_WM_STATE, XCB_ATOM_ATOM, 32, num, values);
+    if (sticky) {
+        DLOG("Setting _NET_WM_STATE_STICKY for window = %d.\n", window);
+        xcb_add_property_atom(conn, window, A__NET_WM_STATE, A__NET_WM_STATE_STICKY);
+    } else {
+        DLOG("Removing _NET_WM_STATE_STICKY for window = %d.\n", window);
+        xcb_remove_property_atom(conn, window, A__NET_WM_STATE, A__NET_WM_STATE_STICKY);
+    }
 }
 
 /*
@@ -263,7 +263,7 @@ void ewmh_setup_hints(void) {
     /* I’m not entirely sure if we need to keep _NET_WM_NAME on root. */
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen("i3"), "i3");
 
-    /* only send the first 31 atoms (last one is _NET_CLOSE_WINDOW) increment that number when adding supported atoms */
+    /* only send the first 32 atoms (last one is _NET_CLOSE_WINDOW) increment that number when adding supported atoms */
     xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTED, XCB_ATOM_ATOM, 32, /* number of atoms */ 32, supported_atoms);
 
     /* We need to map this window to be able to set the input focus to it if no other window is available to be focused. */