mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 02:01:42 -05:00
New setting: 'gapless_monocle'
This commit is contained in:
parent
ce4c9f5887
commit
edd2e2422d
6 changed files with 22 additions and 5 deletions
|
@ -260,6 +260,9 @@ Colors are either [X color names](http://en.wikipedia.org/wiki/X11_color_names)
|
||||||
borderless_monocle
|
borderless_monocle
|
||||||
Whether to remove borders for tiled windows in monocle mode.
|
Whether to remove borders for tiled windows in monocle mode.
|
||||||
|
|
||||||
|
gapless_monocle
|
||||||
|
Whether to remove gaps for tiled windows in monocle mode.
|
||||||
|
|
||||||
focus_follows_mouse
|
focus_follows_mouse
|
||||||
Wether to focus the window under the mouse pointer.
|
Wether to focus the window under the mouse pointer.
|
||||||
|
|
||||||
|
|
3
bspwm.1
3
bspwm.1
|
@ -296,6 +296,9 @@ The modifier mask used for mouse bindings (possible values:
|
||||||
.I borderless_monocle
|
.I borderless_monocle
|
||||||
Whether to remove borders for tiled windows in monocle mode.
|
Whether to remove borders for tiled windows in monocle mode.
|
||||||
.TP
|
.TP
|
||||||
|
.I gapless_monocle
|
||||||
|
Whether to remove gaps for tiled windows in monocle mode.
|
||||||
|
.TP
|
||||||
.I focus_follows_mouse
|
.I focus_follows_mouse
|
||||||
Wether to focus the window under the mouse pointer.
|
Wether to focus the window under the mouse pointer.
|
||||||
.SH MOUSE BINDINGS
|
.SH MOUSE BINDINGS
|
||||||
|
|
|
@ -367,6 +367,10 @@ void set_setting(char *name, char *value, char *rsp)
|
||||||
bool b;
|
bool b;
|
||||||
if (parse_bool(value, &b))
|
if (parse_bool(value, &b))
|
||||||
borderless_monocle = b;
|
borderless_monocle = b;
|
||||||
|
} else if (strcmp(name, "gapless_monocle") == 0) {
|
||||||
|
bool b;
|
||||||
|
if (parse_bool(value, &b))
|
||||||
|
gapless_monocle = b;
|
||||||
} else if (strcmp(name, "focus_follows_mouse") == 0) {
|
} else if (strcmp(name, "focus_follows_mouse") == 0) {
|
||||||
bool b;
|
bool b;
|
||||||
if (parse_bool(value, &b))
|
if (parse_bool(value, &b))
|
||||||
|
@ -436,6 +440,8 @@ void get_setting(char *name, char* rsp)
|
||||||
snprintf(rsp, BUFSIZ, "%s (%06X)", urgent_border_color, urgent_border_color_pxl);
|
snprintf(rsp, BUFSIZ, "%s (%06X)", urgent_border_color, urgent_border_color_pxl);
|
||||||
else if (strcmp(name, "borderless_monocle") == 0)
|
else if (strcmp(name, "borderless_monocle") == 0)
|
||||||
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(borderless_monocle));
|
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(borderless_monocle));
|
||||||
|
else if (strcmp(name, "gapless_monocle") == 0)
|
||||||
|
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(gapless_monocle));
|
||||||
else if (strcmp(name, "focus_follows_mouse") == 0)
|
else if (strcmp(name, "focus_follows_mouse") == 0)
|
||||||
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(focus_follows_mouse));
|
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(focus_follows_mouse));
|
||||||
else if (strcmp(name, "wm_name") == 0)
|
else if (strcmp(name, "wm_name") == 0)
|
||||||
|
|
|
@ -67,5 +67,6 @@ void load_settings(void)
|
||||||
bottom_padding = BOTTOM_PADDING;
|
bottom_padding = BOTTOM_PADDING;
|
||||||
|
|
||||||
borderless_monocle = BORDERLESS_MONOCLE;
|
borderless_monocle = BORDERLESS_MONOCLE;
|
||||||
|
gapless_monocle = GAPLESS_MONOCLE;
|
||||||
focus_follows_mouse = FOCUS_FOLLOWS_MOUSE;
|
focus_follows_mouse = FOCUS_FOLLOWS_MOUSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#define RIGHT_PADDING 0
|
#define RIGHT_PADDING 0
|
||||||
|
|
||||||
#define BORDERLESS_MONOCLE false
|
#define BORDERLESS_MONOCLE false
|
||||||
|
#define GAPLESS_MONOCLE false
|
||||||
#define FOCUS_FOLLOWS_MOUSE false
|
#define FOCUS_FOLLOWS_MOUSE false
|
||||||
|
|
||||||
char focused_border_color[MAXLEN];
|
char focused_border_color[MAXLEN];
|
||||||
|
@ -66,6 +67,7 @@ int left_padding;
|
||||||
int right_padding;
|
int right_padding;
|
||||||
|
|
||||||
bool borderless_monocle;
|
bool borderless_monocle;
|
||||||
|
bool gapless_monocle;
|
||||||
bool focus_follows_mouse;
|
bool focus_follows_mouse;
|
||||||
|
|
||||||
char wm_name[MAXLEN];
|
char wm_name[MAXLEN];
|
||||||
|
|
12
tree.c
12
tree.c
|
@ -266,10 +266,11 @@ void arrange(monitor_t *m, desktop_t *d)
|
||||||
PRINTF("arrange %s%s%s\n", (num_monitors > 1 ? m->name : ""), (num_monitors > 1 ? " " : ""), d->name);
|
PRINTF("arrange %s%s%s\n", (num_monitors > 1 ? m->name : ""), (num_monitors > 1 ? " " : ""), d->name);
|
||||||
|
|
||||||
xcb_rectangle_t rect = m->rectangle;
|
xcb_rectangle_t rect = m->rectangle;
|
||||||
rect.x += left_padding + window_gap;
|
int wg = (gapless_monocle && d->layout == LAYOUT_MONOCLE ? 0 : window_gap);
|
||||||
rect.y += top_padding + window_gap;
|
rect.x += left_padding + wg;
|
||||||
rect.width -= left_padding + right_padding + window_gap;
|
rect.y += top_padding + wg;
|
||||||
rect.height -= top_padding + bottom_padding + window_gap;
|
rect.width -= left_padding + right_padding + wg;
|
||||||
|
rect.height -= top_padding + bottom_padding + wg;
|
||||||
if (focus_follows_mouse)
|
if (focus_follows_mouse)
|
||||||
get_pointer_position(&pointer_position);
|
get_pointer_position(&pointer_position);
|
||||||
apply_layout(m, d, d->root, rect, rect);
|
apply_layout(m, d, d->root, rect, rect);
|
||||||
|
@ -303,7 +304,8 @@ void apply_layout(monitor_t *m, desktop_t *d, node_t *n, xcb_rectangle_t rect, x
|
||||||
r = rect;
|
r = rect;
|
||||||
else if (d->layout == LAYOUT_MONOCLE)
|
else if (d->layout == LAYOUT_MONOCLE)
|
||||||
r = root_rect;
|
r = root_rect;
|
||||||
int bleed = window_gap + 2 * n->client->border_width;
|
int wg = (gapless_monocle && d->layout == LAYOUT_MONOCLE ? 0 : window_gap);
|
||||||
|
int bleed = wg + 2 * n->client->border_width;
|
||||||
r.width = (bleed < r.width ? r.width - bleed : 1);
|
r.width = (bleed < r.width ? r.width - bleed : 1);
|
||||||
r.height = (bleed < r.height ? r.height - bleed : 1);
|
r.height = (bleed < r.height ? r.height - bleed : 1);
|
||||||
n->client->tiled_rectangle = r;
|
n->client->tiled_rectangle = r;
|
||||||
|
|
Loading…
Add table
Reference in a new issue