summarylogtreecommitdiffstats
path: root/gaps.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gaps.patch')
-rw-r--r--gaps.patch184
1 files changed, 135 insertions, 49 deletions
diff --git a/gaps.patch b/gaps.patch
index 9c1b86319dec..883fea49dd8a 100644
--- a/gaps.patch
+++ b/gaps.patch
@@ -1,95 +1,181 @@
---- a/src/client.c 2022-12-01 11:47:40.000000000 +0100
-+++ b/src/client.c 2022-12-22 23:26:04.000673794 +0100
-@@ -3292,6 +3292,9 @@
- }
- }
-
-+// @gaps@
-+#define GAPS_SIZE 25
-+
+--- a/defaults/defaults 2021-01-12 21:42:12.000000000 +0200
++++ b/defaults/defaults 2023-06-16 08:38:06.504599096 +0200
+@@ -25,6 +25,11 @@
+ frame_border_top=0
+ frame_opacity=100
+ full_width_title=true
++gap_bottom=0
++gap_inner=0
++gap_left=0
++gap_right=0
++gap_top=0
+ horiz_scroll_opacity=false
+ inactive_opacity=100
+ maximized_offset=0
+--- a/src/client.c 2022-12-01 12:47:40.000000000 +0200
++++ b/src/client.c 2023-06-16 08:53:10.857981141 +0200
+@@ -3295,6 +3295,9 @@
static gboolean
clientNewTileSize (Client *c, XWindowChanges *wc, GdkRectangle *rect, tilePositionType tile)
{
-@@ -3318,36 +3321,70 @@
++ ScreenInfo *screen_info;
++ screen_info = c->screen_info;
++
+ GdkRectangle full;
+
+ clientMaxSpaceForGeometry (c, rect, &full);
+@@ -3318,36 +3321,60 @@
wc->y = full.y + frameExtentTop (c);
wc->width = full.width / 2 - frameExtentLeft (c) - frameExtentRight (c);
wc->height = full.height - frameExtentTop (c) - frameExtentBottom (c);
-+
-+ wc->x += GAPS_SIZE;
-+ wc->y += GAPS_SIZE;
-+ wc->width -= GAPS_SIZE + (GAPS_SIZE / 2);
-+ wc->height -= GAPS_SIZE * 2;
-+
++ wc->x += screen_info->params->gap_left;
++ wc->y += screen_info->params->gap_top;
++ wc->width -= screen_info->params->gap_left + (screen_info->params->gap_inner / 2);
++ wc->height -= screen_info->params->gap_top + screen_info->params->gap_bottom;
break;
case TILE_RIGHT:
wc->x = full.x + full.width / 2 + frameExtentLeft (c);
wc->y = full.y + frameExtentTop (c);
wc->width = full.width - full.width / 2 - frameExtentLeft (c) - frameExtentRight (c);
wc->height = full.height - frameExtentTop (c) - frameExtentBottom (c);
-+
-+ wc->x += GAPS_SIZE / 2;
-+ wc->y += GAPS_SIZE;
-+ wc->width -= GAPS_SIZE + (GAPS_SIZE / 2);
-+ wc->height -= GAPS_SIZE * 2;
-+
++ wc->x += screen_info->params->gap_inner / 2;
++ wc->y += screen_info->params->gap_top;
++ wc->width -= screen_info->params->gap_right + (screen_info->params->gap_inner / 2);
++ wc->height -= screen_info->params->gap_top + screen_info->params->gap_bottom;
break;
case TILE_DOWN_LEFT:
wc->x = full.x + frameExtentLeft (c);
wc->y = full.y + full.height / 2 + frameExtentTop (c);
wc->width = full.width / 2 - frameExtentLeft (c) - frameExtentRight (c);
wc->height = full.height - full.height / 2 - frameExtentTop (c) - frameExtentBottom (c);
-+ wc->x += GAPS_SIZE;
-+ wc->y += GAPS_SIZE / 2;
-+ wc->width -= GAPS_SIZE + (GAPS_SIZE / 2);
-+ wc->height -= GAPS_SIZE + (GAPS_SIZE / 2);
-+
++ wc->x += screen_info->params->gap_left;
++ wc->y += screen_info->params->gap_inner / 2;
++ wc->width -= screen_info->params->gap_left + (screen_info->params->gap_inner / 2);
++ wc->height -= screen_info->params->gap_bottom + (screen_info->params->gap_inner / 2);
break;
case TILE_DOWN_RIGHT:
wc->x = full.x + full.width /2 + frameExtentLeft (c);
wc->y = full.y + full.height / 2 + frameExtentTop (c);
wc->width = full.width - full.width / 2 - frameExtentLeft (c) - frameExtentRight (c);
wc->height = full.height - full.height / 2 - frameExtentTop (c) - frameExtentBottom (c);
-+ wc->x += GAPS_SIZE / 2;
-+ wc->y += GAPS_SIZE / 2;
-+ wc->width -= GAPS_SIZE + (GAPS_SIZE / 2);
-+ wc->height -= GAPS_SIZE + (GAPS_SIZE / 2);
-+
++ wc->x += screen_info->params->gap_inner / 2;
++ wc->y += screen_info->params->gap_inner / 2;
++ wc->width -= screen_info->params->gap_right + (screen_info->params->gap_inner / 2);
++ wc->height -= screen_info->params->gap_bottom + (screen_info->params->gap_inner / 2);
break;
case TILE_UP_LEFT:
wc->x = full.x + frameExtentLeft (c);
wc->y = full.y + frameExtentTop (c);
wc->width = full.width / 2 - frameExtentLeft (c) - frameExtentRight (c);
wc->height = full.height / 2 - frameExtentTop (c) - frameExtentBottom (c);
-+
-+ wc->x += GAPS_SIZE;
-+ wc->y += GAPS_SIZE;
-+ wc->width -= GAPS_SIZE + (GAPS_SIZE / 2);
-+ wc->height -= GAPS_SIZE + (GAPS_SIZE / 2);
-+
++ wc->x += screen_info->params->gap_left;
++ wc->y += screen_info->params->gap_top;
++ wc->width -= screen_info->params->gap_left + (screen_info->params->gap_inner / 2);
++ wc->height -= screen_info->params->gap_top + (screen_info->params->gap_inner / 2);
break;
case TILE_UP_RIGHT:
wc->x = full.x + full.width /2 + frameExtentLeft (c);
wc->y = full.y + frameExtentTop (c);
wc->width = full.width - full.width / 2 - frameExtentLeft (c) - frameExtentRight (c);
wc->height = full.height / 2 - frameExtentTop (c) - frameExtentBottom (c);
-+
-+ wc->x += GAPS_SIZE / 2;
-+ wc->y += GAPS_SIZE;
-+ wc->width -= GAPS_SIZE + (GAPS_SIZE / 2);
-+ wc->height -= GAPS_SIZE + (GAPS_SIZE / 2);
-+
++ wc->x += screen_info->params->gap_inner / 2;
++ wc->y += screen_info->params->gap_top;
++ wc->width -= screen_info->params->gap_right + (screen_info->params->gap_inner / 2);
++ wc->height -= screen_info->params->gap_top + (screen_info->params->gap_inner / 2);
break;
default:
break;
-@@ -3378,6 +3415,11 @@
+@@ -3360,6 +3387,9 @@
+ static gboolean
+ clientNewMaxSize (Client *c, XWindowChanges *wc, GdkRectangle *rect)
+ {
++ ScreenInfo *screen_info;
++ screen_info = c->screen_info;
++
+ GdkRectangle full;
+
+ clientMaxSpaceForGeometry (c, rect, &full);
+@@ -3378,6 +3408,11 @@
wc->height = full.height - frameExtentTop (c) - frameExtentBottom (c);
}
-+ wc->x += GAPS_SIZE;
-+ wc->y += GAPS_SIZE;
-+ wc->width -= GAPS_SIZE * 2;
-+ wc->height -= GAPS_SIZE * 2;
++ wc->x += screen_info->params->gap_left;
++ wc->y += screen_info->params->gap_top;
++ wc->width -= screen_info->params->gap_left + screen_info->params->gap_right;
++ wc->height -= screen_info->params->gap_top + screen_info->params->gap_bottom;
+
return ((wc->height >= c->size->min_height) && (wc->height <= c->size->max_height) &&
(wc->width >= c->size->min_width) && (wc->width <= c->size->max_width));
}
+--- a/src/settings.c 2022-11-12 22:57:54.000000000 +0200
++++ b/src/settings.c 2023-06-16 08:42:06.661278695 +0200
+@@ -693,6 +693,11 @@
+ {"frame_opacity", NULL, G_TYPE_INT, TRUE},
+ {"frame_border_top", NULL, G_TYPE_INT, TRUE},
+ {"full_width_title", NULL, G_TYPE_BOOLEAN, TRUE},
++ {"gap_bottom", NULL, G_TYPE_INT, TRUE},
++ {"gap_inner", NULL, G_TYPE_INT, TRUE},
++ {"gap_left", NULL, G_TYPE_INT, TRUE},
++ {"gap_right", NULL, G_TYPE_INT, TRUE},
++ {"gap_top", NULL, G_TYPE_INT, TRUE},
+ {"horiz_scroll_opacity", NULL, G_TYPE_BOOLEAN, FALSE},
+ {"inactive_opacity", NULL, G_TYPE_INT, TRUE},
+ {"margin_bottom", NULL, G_TYPE_INT, FALSE},
+@@ -793,6 +798,16 @@
+ getBoolValue ("focus_hint", rc);
+ screen_info->params->focus_new =
+ getBoolValue ("focus_new", rc);
++ screen_info->params->gap_bottom =
++ getIntValue ("gap_bottom", rc);
++ screen_info->params->gap_inner =
++ getIntValue ("gap_inner", rc);
++ screen_info->params->gap_left =
++ getIntValue ("gap_left", rc);
++ screen_info->params->gap_right =
++ getIntValue ("gap_right", rc);
++ screen_info->params->gap_top =
++ getIntValue ("gap_top", rc);
+ screen_info->params->horiz_scroll_opacity =
+ getBoolValue ("horiz_scroll_opacity", rc);
+ screen_info->params->mousewheel_rollup =
+@@ -1238,6 +1253,26 @@
+ {
+ screen_info->params->cycle_tabwin_mode = CLAMP (g_value_get_int(value), 0, 1);
+ }
++ else if (!strcmp (name, "gap_bottom"))
++ {
++ screen_info->params->gap_bottom = g_value_get_int(value);
++ }
++ else if (!strcmp (name, "gap_inner"))
++ {
++ screen_info->params->gap_inner = g_value_get_int(value);
++ }
++ else if (!strcmp (name, "gap_left"))
++ {
++ screen_info->params->gap_left = g_value_get_int(value);
++ }
++ else if (!strcmp (name, "gap_right"))
++ {
++ screen_info->params->gap_right = g_value_get_int(value);
++ }
++ else if (!strcmp (name, "gap_top"))
++ {
++ screen_info->params->gap_top = g_value_get_int(value);
++ }
+ else if ((!strcmp (name, "button_offset"))
+ || (!strcmp (name, "button_spacing"))
+ || (!strcmp (name, "double_click_time"))
+--- a/src/settings.h 2022-11-12 22:57:54.000000000 +0200
++++ b/src/settings.h 2023-06-16 08:39:23.487936574 +0200
+@@ -190,6 +190,11 @@
+ int focus_delay;
+ int frame_opacity;
+ int frame_border_top;
++ int gap_bottom;
++ int gap_inner;
++ int gap_left;
++ int gap_right;
++ int gap_top;
+ int inactive_opacity;
+ int maximized_offset;
+ int move_opacity;