]> Dogcows Code - chaz/openbox/blobdiff - openbox/place.c
Merge branch 'master' into chaz
[chaz/openbox] / openbox / place.c
index 48e4fb16a8d0a17873a56d8af34dde8fef056735..7d5c869439863e7cd594b02aa94e72c074af8668 100644 (file)
@@ -27,8 +27,6 @@
 #include "debug.h"
 #include "place_overlap.h"
 
-extern ObDock *dock;
-
 static Rect *choose_pointer_monitor(ObClient *c)
 {
     return screen_area(c->desktop, screen_monitor_pointer(), NULL);
@@ -324,28 +322,32 @@ static void place_per_app_setting_size(ObClient *client, Rect *screen,
                                        gint *w, gint *h,
                                        ObAppSettings *settings)
 {
-    if (!settings || !settings->size_given)
+    if (!settings)
         return;
 
-    ob_debug("sizing by per-app settings");
-
-    g_assert(settings->width_num > 0);
+    g_assert(settings->width_num >= 0);
     g_assert(settings->width_denom >= 0);
-    g_assert(settings->height_num > 0);
+    g_assert(settings->height_num >= 0);
     g_assert(settings->height_denom >= 0);
 
-    if (!settings->width_denom)
-        *w = settings->width_num;
-    else {
-        *w = screen->width * settings->width_num / settings->width_denom;
-        *w = MIN(*w, screen->width);
+    if (settings->width_num) {
+        ob_debug("setting width by per-app settings");
+        if (!settings->width_denom)
+            *w = settings->width_num;
+        else {
+            *w = screen->width * settings->width_num / settings->width_denom;
+            *w = MIN(*w, screen->width);
+        }
     }
 
-    if (!settings->height_denom)
-        *h = settings->height_num;
-    else {
-        *h = screen->height * settings->height_num / settings->height_denom;
-        *h = MIN(*h, screen->height);
+    if (settings->height_num) {
+        ob_debug("setting height by per-app settings");
+        if (!settings->height_denom)
+            *h = settings->height_num;
+        else {
+            *h = screen->height * settings->height_num / settings->height_denom;
+            *h = MIN(*h, screen->height);
+        }
     }
 }
 
@@ -402,7 +404,7 @@ static gboolean place_least_overlap(ObClient *c, Rect *head, int *x, int *y,
     /* Assemble the list of windows that could overlap with @c in the user's
        current view. */
     GSList* potential_overlap_clients = NULL;
-    gint n_client_rects = 0;
+    gint n_client_rects = config_dock_hide ? 0 : 1;
 
     /* if we're "showing desktop", ignore all existing windows */
     if (!screen_showing_desktop) {
@@ -434,6 +436,8 @@ static gboolean place_least_overlap(ObClient *c, Rect *head, int *x, int *y,
 
     GSList* it;
     guint i = 0;
+    if (!config_dock_hide)
+        dock_get_area(&client_rects[i++]);
     for (it = potential_overlap_clients; it != NULL; it = g_slist_next(it)) {
         ObClient* potential_overlap_client = (ObClient*)it->data;
         client_rects[i] = potential_overlap_client->frame->area;
This page took 0.021895 seconds and 4 git commands to generate.