]> Dogcows Code - chaz/openbox/commitdiff
fix how the dock is placed, its struts, and set a window type hint on it
authorDana Jansens <danakj@orodu.net>
Wed, 13 Jun 2007 02:32:20 +0000 (02:32 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 13 Jun 2007 02:32:20 +0000 (02:32 +0000)
openbox/dock.c

index 121565ac0cbfa1c57badc3e999403fb75c31e5e5..d8ca062d489a5cf92c0d4677a5fdacf5864410cb 100644 (file)
@@ -94,6 +94,10 @@ void dock_startup(gboolean reconfig)
                      RrColorPixel(ob_rr_theme->osd_border_color));
     XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->obwidth);
 
+    /* Setting the window type so xcompmgr can tell what it is */
+    PROP_SET32(dock->frame, net_wm_window_type, atom,
+               prop_atoms.net_wm_window_type_dock);
+
     g_hash_table_insert(window_map, &dock->frame, dock);
     stacking_add(DOCK_AS_WINDOW(dock));
 }
@@ -214,13 +218,13 @@ void dock_remove(ObDockApp *app, gboolean reparent)
 void dock_configure()
 {
     GList *it;
-    gint spot;
+    gint hspot, vspot;
     gint gravity;
-    gint minw, minh;
+    gint l, r, t, b;
     gint strw, strh;
     Rect *a;
 
-    RrMinSize(dock->a_frame, &minw, &minh);
+    RrMargins(dock->a_frame, &l, &t, &r, &b);
 
     dock->w = dock->h = 0;
 
@@ -239,21 +243,25 @@ void dock_configure()
         }
     }
 
-    spot = (config_dock_orient == OB_ORIENTATION_HORZ ? minw : minh) / 2;
+    dock->w += l + r;
+    dock->h += t + b;
+
+    hspot = l;
+    vspot = t;
 
     /* position the apps */
     for (it = dock->dock_apps; it; it = g_list_next(it)) {
         ObDockApp *app = it->data;
         switch (config_dock_orient) {
         case OB_ORIENTATION_HORZ:
-            app->x = spot;
+            app->x = hspot;
             app->y = (dock->h - app->h) / 2;
-            spot += app->w;
+            hspot += app->w;
             break;
         case OB_ORIENTATION_VERT:
             app->x = (dock->w - app->w) / 2;
-            app->y = spot;
-            spot += app->h;
+            app->y = vspot;
+            vspot += app->h;
             break;
         }
 
@@ -435,8 +443,8 @@ void dock_configure()
             break;
         case OB_DIRECTION_NORTH:
             STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
-                              dock->x, dock->x + dock->w - 1,
-                              0, 0, 0, 0, 0, 0);
+                              0, 0, dock->x, dock->x + dock->w - 1,
+                              0, 0, 0, 0);
             break;
         case OB_DIRECTION_NORTHEAST:
             switch (config_dock_orient) {
@@ -498,9 +506,6 @@ void dock_configure()
         }
     }
 
-    dock->w += minw;
-    dock->h += minh;
-
     /* not used for actually sizing shit */
     dock->w -= ob_rr_theme->obwidth * 2;
     dock->h -= ob_rr_theme->obwidth * 2;
This page took 0.025451 seconds and 4 git commands to generate.