]> git.sur5r.net Git - i3/i3/blobdiff - src/ewmh.c
Implement new 'sticky' command to manually set, remove or toggle the sticky state...
[i3/i3] / src / ewmh.c
index 36c6a16080d263569bda9b4daa4c99625a870bea..eb6a6ea60d39af252364885f87f9b0f695ecb9ba 100644 (file)
@@ -213,6 +213,20 @@ void ewmh_update_client_list_stacking(xcb_window_t *stack, int num_windows) {
         stack);
 }
 
+/*
+ * Set or remove _NET_WM_STATE_STICKY on the window.
+ *
+ */
+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);
+}
+
 /*
  * Set up the EWMH hints on the root window.
  *