1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
diff --git a/defaults/defaults b/defaults/defaults
index 83e873ff6..a53a4bbca 100644
--- a/defaults/defaults
+++ b/defaults/defaults
@@ -25,6 +25,12 @@ focus_new=true
frame_border_top=0
frame_opacity=100
full_width_title=true
+gap_bottom=0
+gap_inner=0
+gap_left=0
+gap_maximize=true
+gap_right=0
+gap_top=0
horiz_scroll_opacity=false
inactive_opacity=100
maximized_offset=0
diff --git a/src/client.c b/src/client.c
index 2b8506626..e7948adad 100644
--- a/src/client.c
+++ b/src/client.c
@@ -3291,6 +3291,9 @@ clientNewMaxState (Client *c, XWindowChanges *wc, int mode)
static gboolean
clientNewTileSize (Client *c, XWindowChanges *wc, GdkRectangle rect, tilePositionType tile)
{
+ ScreenInfo *screen_info;
+ screen_info = c->screen_info;
+
GdkRectangle full = clientMaxSpaceForGeometry (c, rect);
switch (tile)
@@ -3312,36 +3315,60 @@ clientNewTileSize (Client *c, XWindowChanges *wc, GdkRectangle rect, tilePositio
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 += 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 += 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 += 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 += 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 += 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 += 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:
return FALSE;
@@ -3354,6 +3381,9 @@ clientNewTileSize (Client *c, XWindowChanges *wc, GdkRectangle rect, tilePositio
static gboolean
clientNewMaxSize (Client *c, XWindowChanges *wc, GdkRectangle max_rect)
{
+ ScreenInfo *screen_info;
+ screen_info = c->screen_info;
+
GdkRectangle full = clientMaxSpaceForGeometry (c, max_rect);
if (FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED_HORIZ))
@@ -3370,6 +3400,13 @@ clientNewMaxSize (Client *c, XWindowChanges *wc, GdkRectangle max_rect)
wc->height = full.height - frameExtentTop (c) - frameExtentBottom (c);
}
+ if (screen_info->params->gap_maximize) {
+ 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));
}
diff --git a/src/settings.c b/src/settings.c
index 385c680c2..eb65adf5e 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -707,6 +707,12 @@ loadSettings (ScreenInfo *screen_info)
{"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_maximize", NULL, G_TYPE_BOOLEAN, 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},
@@ -807,6 +813,18 @@ loadSettings (ScreenInfo *screen_info)
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_maximize =
+ getBoolValue ("gap_maximize", 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 =
@@ -1258,6 +1276,26 @@ cb_xfwm4_channel_property_changed(XfconfChannel *channel, const gchar *property_
{
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"))
@@ -1298,6 +1336,10 @@ cb_xfwm4_channel_property_changed(XfconfChannel *channel, const gchar *property_
{
screen_info->params->focus_new = g_value_get_boolean (value);
}
+ else if (!strcmp (name, "gap_maximize"))
+ {
+ screen_info->params->gap_maximize = g_value_get_boolean (value);
+ }
else if (!strcmp (name, "raise_on_focus"))
{
screen_info->params->raise_on_focus = g_value_get_boolean (value);
diff --git a/src/settings.h b/src/settings.h
index 612ee2e8a..15e8768e7 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -190,6 +190,11 @@ struct _XfwmParams
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;
@@ -209,6 +214,7 @@ struct _XfwmParams
int title_shadow[2];
int wrap_resistance;
gboolean borderless_maximize;
+ gboolean gap_maximize;
gboolean titleless_maximize;
gboolean box_move;
gboolean box_resize;
|