]> Dogcows Code - chaz/openbox/blobdiff - openbox/dock.c
use strcmp instead of collate, since collate is slower and we're only doing an =...
[chaz/openbox] / openbox / dock.c
index 3dda174dbee21e2aeb0feb9e8af97d2dfc433c8e..4166ba220b032d3cb3fa2defa7dae68b239a7d65 100644 (file)
@@ -150,8 +150,12 @@ void dock_configure()
     GList *it;
     int spot;
     int gravity;
+    int minw, minh;
+    Rect *a;
 
-    dock->w = dock->h = spot = 0;
+    RrMinsize(dock->a_frame, &minw, &minh);
+
+    dock->w = dock->h = 0;
 
     /* get the size */
     for (it = dock->dock_apps; it; it = it->next) {
@@ -165,6 +169,8 @@ void dock_configure()
         }
     }
 
+    spot = (config_dock_horz ? minw : minh) / 2;
+
     /* position the apps */
     for (it = dock->dock_apps; it; it = it->next) {
         struct DockApp *app = it->data;
@@ -185,6 +191,8 @@ void dock_configure()
     dock->w += ob_rr_theme->bwidth * 2;
     dock->h += ob_rr_theme->bwidth * 2;
 
+    a = screen_physical_area();
+
     /* calculate position */
     switch (config_dock_pos) {
     case DockPos_Floating:
@@ -198,38 +206,38 @@ void dock_configure()
         gravity = NorthWestGravity;
         break;
     case DockPos_Top:
-        dock->x = screen_physical_size.width / 2;
+        dock->x = a->width / 2;
         dock->y = 0;
         gravity = NorthGravity;
         break;
     case DockPos_TopRight:
-        dock->x = screen_physical_size.width;
+        dock->x = a->width;
         dock->y = 0;
         gravity = NorthEastGravity;
         break;
     case DockPos_Left:
         dock->x = 0;
-        dock->y = screen_physical_size.height / 2;
+        dock->y = a->height / 2;
         gravity = WestGravity;
         break;
     case DockPos_Right:
-        dock->x = screen_physical_size.width;
-        dock->y = screen_physical_size.height / 2;
+        dock->x = a->width;
+        dock->y = a->height / 2;
         gravity = EastGravity;
         break;
     case DockPos_BottomLeft:
         dock->x = 0;
-        dock->y = screen_physical_size.height;
+        dock->y = a->height;
         gravity = SouthWestGravity;
         break;
     case DockPos_Bottom:
-        dock->x = screen_physical_size.width / 2;
-        dock->y = screen_physical_size.height;
+        dock->x = a->width / 2;
+        dock->y = a->height;
         gravity = SouthGravity;
         break;
     case DockPos_BottomRight:
-        dock->x = screen_physical_size.width;
-        dock->y = screen_physical_size.height;
+        dock->x = a->width;
+        dock->y = a->height;
         gravity = SouthEastGravity;
         break;
     }
@@ -345,6 +353,9 @@ void dock_configure()
         break;
     }
 
+    dock->w += minw;
+    dock->h += minh;
+
     /* not used for actually sizing shit */
     dock->w -= ob_rr_theme->bwidth * 2;
     dock->h -= ob_rr_theme->bwidth * 2;
@@ -362,7 +373,7 @@ void dock_configure()
     dock->w += ob_rr_theme->bwidth * 2;
     dock->h += ob_rr_theme->bwidth * 2;
 
-    screen_update_struts();
+    screen_update_areas();
 }
 
 void dock_app_configure(DockApp *app, int w, int h)
This page took 0.023439 seconds and 4 git commands to generate.