]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
fix _NET_WM_STRUT oldschool support
[chaz/openbox] / openbox / client.c
index cc5d80cad5c2fea39cd6a556b0ca443f6daf1c0c..8734ce491596352bfc03b92e01c36454b348d762 100644 (file)
@@ -851,21 +851,24 @@ static void client_get_state(ObClient *self)
     }
 
     if (!(self->above || self->below)) {
-        if (client_has_group_siblings(self)) {
+        if (self->group) {
             /* apply stuff from the group */
             GSList *it;
-            gint layer = -1;
+            gint layer = -2;
 
             for (it = self->group->members; it; it = g_slist_next(it)) {
                 ObClient *c = it->data;
                 if (c != self && !client_search_transient(self, c))
+                {
                     layer = MAX(layer,
                                 (c->above ? 1 : (c->below ? -1 : 0)));
+                }
             }
             switch (layer) {
             case -1:
                 self->below = TRUE;
                 break;
+            case -2:
             case 0:
                 break;
             case 1:
@@ -1093,6 +1096,9 @@ void client_update_normal_hints(ObClient *self)
 
     /* get the hints from the window */
     if (XGetWMNormalHints(ob_display, self->window, &size, &ret)) {
+        /* normal windows can't request placement! har har
+        if (!client_normal(self))
+        */
         self->positioned = !!(size.flags & (PPosition|USPosition));
 
         if (size.flags & PWinGravity) {
@@ -1535,10 +1541,19 @@ void client_update_strut(ObClient *self)
     if (!got &&
         PROP_GETA32(self->window, net_wm_strut, cardinal, &data, &num)) {
         if (num == 4) {
+            const Rect *a;
+
             got = TRUE;
+
+            /* use the screen's width/height */
+            a = screen_physical_area();
+
             STRUT_PARTIAL_SET(strut,
                               data[0], data[2], data[1], data[3],
-                              0, 0, 0, 0, 0, 0, 0, 0);
+                              a->y, a->y + a->height - 1,
+                              a->x, a->x + a->width - 1,
+                              a->y, a->y + a->height - 1,
+                              a->x, a->x + a->width - 1);
         }
         g_free(data);
     }
@@ -1793,12 +1808,31 @@ void client_calc_layer(ObClient *self)
 
 gboolean client_should_show(ObClient *self)
 {
-    if (self->iconic) return FALSE;
-    else if (!(self->desktop == screen_desktop ||
-               self->desktop == DESKTOP_ALL)) return FALSE;
-    else if (client_normal(self) && screen_showing_desktop) return FALSE;
+    if (self->iconic)
+        return FALSE;
+    if (client_normal(self) && screen_showing_desktop)
+        return FALSE;
+    /*
+    if (self->transient_for) {
+        if (self->transient_for != OB_TRAN_GROUP)
+            return client_should_show(self->transient_for);
+        else {
+            GSList *it;
+
+            for (it = self->group->members; it; it = g_slist_next(it)) {
+                ObClient *c = it->data;
+                if (c != self && !c->transient_for) {
+                    if (client_should_show(c))
+                        return TRUE;
+                }
+            }
+        }
+    }
+    */
+    if (self->desktop == screen_desktop || self->desktop == DESKTOP_ALL)
+        return TRUE;
     
-    return TRUE;
+    return FALSE;
 }
 
 static void client_showhide(ObClient *self)
This page took 0.025861 seconds and 4 git commands to generate.