From 3e153f428dcf48d18510c959a2578086113dd1bf Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 25 Nov 2011 14:03:18 -0500 Subject: [PATCH] Only shrink windows on GrowToEdge if "shrinkonscreenedge" is set to true --- openbox/actions/growtoedge.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openbox/actions/growtoedge.c b/openbox/actions/growtoedge.c index 9e74fa08..1d4ce869 100644 --- a/openbox/actions/growtoedge.c +++ b/openbox/actions/growtoedge.c @@ -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! */ -- 2.34.1