]> code.delx.au - spectrwm/blobdiff - spectrwm.c
Allow apps to manually manage SKIP_TASKBAR and SKIP_PAGER
[spectrwm] / spectrwm.c
index 6ba69d202913fe3ba8feb9b476a86fd1f4c0cd5e..dde9b701b2889f0ef847fa1860c0db5eed2fd97c 100644 (file)
@@ -988,7 +988,6 @@ void         bar_toggle(struct binding *, struct swm_region *, union arg *);
 void    bar_urgent(char *, size_t);
 void    bar_window_class(char *, size_t, struct swm_region *);
 void    bar_window_class_instance(char *, size_t, struct swm_region *);
-void    bar_window_float(char *, size_t, struct swm_region *);
 void    bar_window_instance(char *, size_t, struct swm_region *);
 void    bar_window_name(char *, size_t, struct swm_region *);
 void    bar_window_state(char *, size_t, struct swm_region *);
@@ -1589,6 +1588,25 @@ ewmh_autoquirk(struct ws_win *win)
                }
        }
        free(r);
+
+
+       c = xcb_get_property(conn, 0, win->id,
+           ewmh[_NET_WM_STATE].atom, XCB_ATOM_ATOM, 0, UINT32_MAX);
+       r = xcb_get_property_reply(conn, c, NULL);
+       if (r == NULL)
+               return;
+
+       type = xcb_get_property_value(r);
+       n = xcb_get_property_value_length(r) / sizeof(xcb_atom_t);
+
+       for (i = 0; i < n; i++) {
+               if (type[i] == ewmh[_NET_WM_STATE_SKIP_PAGER].atom ||
+                   type[i] == ewmh[_NET_WM_STATE_SKIP_TASKBAR].atom) {
+                       win->quirks = SWM_Q_FLOAT | SWM_Q_ANYWHERE;
+                       break;
+               }
+       }
+       free(r);
 }
 
 void
@@ -9885,11 +9903,6 @@ manage_window(xcb_window_t id, int spawn_pos, bool mapping)
                DNPRINTF(SWM_D_MISC, "manage_window: win %#x found on "
                    "unmanaged list.\n", id);
                TAILQ_REMOVE(&win->ws->unmanagedlist, win, entry);
-
-               if (TRANS(win))
-                       set_child_transient(win, &trans);
-
-               goto remanage;
        } else {
                DNPRINTF(SWM_D_MISC, "manage_window: win %#x is new.\n", id);
        }
@@ -9931,12 +9944,14 @@ manage_window(xcb_window_t id, int spawn_pos, bool mapping)
                goto out;
        }
 
-       /* Create and initialize ws_win object. */
-       if ((win = calloc(1, sizeof(struct ws_win))) == NULL)
-               err(1, "manage_window: calloc: failed to allocate memory for "
-                   "new window");
+       if (!win) {
+               /* Create and initialize ws_win object. */
+               if ((win = calloc(1, sizeof(struct ws_win))) == NULL)
+                       err(1, "manage_window: calloc: failed to allocate "
+                           "memory for new window");
 
-       win->id = id;
+               win->id = id;
+       }
 
        /* Ignore window border if there is one. */
        WIDTH(win) = gr->width;
@@ -10067,7 +10082,6 @@ manage_window(xcb_window_t id, int spawn_pos, bool mapping)
                update_window(win);
        }
 
-remanage:
        /* Figure out where to insert the window in the workspace list. */
        if (trans && (ww = find_window(trans)))
                TAILQ_INSERT_AFTER(&win->ws->winlist, ww, win, entry);