Only shrink windows on GrowToEdge if "shrinkonscreenedge" is set to true
authorDana Jansens <danakj@orodu.net>
Fri, 25 Nov 2011 19:03:18 +0000 (14:03 -0500)
committerDana Jansens <danakj@orodu.net>
Fri, 25 Nov 2011 19:04:24 +0000 (14:04 -0500)
openbox/actions/growtoedge.c

index 9e74fa0878d80944e2bfd6336adad24ac18cfba3..1d4ce869011dfedc17a0449320dbf12a3a8976a3 100644 (file)
@@ -11,6 +11,7 @@
 typedef struct {
     ObDirection dir;
     gboolean shrink;
+    gboolean shrink_if_grow_fails;
 } Options;
 
 static gpointer setup_func(GHashTable *config);
@@ -52,6 +53,9 @@ static gpointer setup_func(GHashTable *config)
                  !g_ascii_strcasecmp(s, "right"))
             o->dir = OB_DIRECTION_EAST;
     }
+    v = g_hash_table_lookup(config, "shrinkonscreenedge");
+    if (v && config_value_is_string(v))
+        o->shrink_if_grow_fails = config_value_bool(v);
 
     return o;
 }
@@ -115,6 +119,8 @@ static gboolean each_run(ObClient *c,
         client_find_resize_directional(c, o->dir, TRUE, &x, &y, &w, &h);
         if (do_grow(data, x, y, w, h))
             return TRUE;
+        if (!o->shrink_if_grow_fails)
+            return TRUE;
     }
 
     /* we couldn't grow, so try shrink! */