]> git.sur5r.net Git - i3/i3/blobdiff - src/mainx.c
Add support for WM_CLIENT_LEADER, put floating windows mapping to (0x0) to center...
[i3/i3] / src / mainx.c
index 03cb9d1b647d53034ec3e9abb0c63c6c679d70fb..27e026b57ec3881b2d3bcba92d06a617993fe40f 100644 (file)
@@ -178,6 +178,7 @@ int main(int argc, char *argv[], char *env[]) {
         REQUEST_ATOM(WM_DELETE_WINDOW);
         REQUEST_ATOM(UTF8_STRING);
         REQUEST_ATOM(WM_STATE);
+        REQUEST_ATOM(WM_CLIENT_LEADER);
 
         /* TODO: this has to be more beautiful somewhen */
         int major, minor, error;
@@ -308,6 +309,7 @@ int main(int argc, char *argv[], char *env[]) {
         GET_ATOM(WM_DELETE_WINDOW);
         GET_ATOM(UTF8_STRING);
         GET_ATOM(WM_STATE);
+        GET_ATOM(WM_CLIENT_LEADER);
 
         xcb_property_set_handler(&prophs, atoms[_NET_WM_WINDOW_TYPE], UINT_MAX, handle_window_type, NULL);
         /* TODO: In order to comply with EWMH, we have to watch _NET_WM_STRUT_PARTIAL */
@@ -324,6 +326,9 @@ int main(int argc, char *argv[], char *env[]) {
         /* Watch WM_CLASS (= class of the window) */
         xcb_property_set_handler(&prophs, WM_CLASS, 128, handle_windowclass_change, NULL);
 
+        /* Watch WM_CLIENT_LEADER (= logical parent window for toolbars etc.) */
+        xcb_property_set_handler(&prophs, atoms[WM_CLIENT_LEADER], UINT_MAX, handle_clientleader_change, NULL);
+
         /* Set up the atoms we support */
         check_error(conn, xcb_change_property_checked(conn, XCB_PROP_MODE_REPLACE, root, atoms[_NET_SUPPORTED],
                        ATOM, 32, 7, atoms), "Could not set _NET_SUPPORTED");