mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-02 09:01:43 -05:00
feat: add option no_border_when_single=1
This commit is contained in:
parent
11313d9e17
commit
0e527298c5
4 changed files with 28 additions and 0 deletions
|
|
@ -44,6 +44,7 @@ overviewgappi=5
|
||||||
overviewgappo=30
|
overviewgappo=30
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
|
no_border_when_single=0
|
||||||
axis_bind_apply_timeout=100
|
axis_bind_apply_timeout=100
|
||||||
focus_on_activate=1
|
focus_on_activate=1
|
||||||
bypass_surface_visibility=0
|
bypass_surface_visibility=0
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@ typedef struct {
|
||||||
int scroller_prefer_center;
|
int scroller_prefer_center;
|
||||||
int focus_cross_monitor;
|
int focus_cross_monitor;
|
||||||
int focus_cross_tag;
|
int focus_cross_tag;
|
||||||
|
int no_border_when_single;
|
||||||
int snap_distance;
|
int snap_distance;
|
||||||
int enable_floating_snap;
|
int enable_floating_snap;
|
||||||
unsigned int swipe_min_threshold;
|
unsigned int swipe_min_threshold;
|
||||||
|
|
@ -726,6 +727,8 @@ void parse_config_line(Config *config, const char *line) {
|
||||||
config->focus_cross_monitor = atoi(value);
|
config->focus_cross_monitor = atoi(value);
|
||||||
} else if (strcmp(key, "focus_cross_tag") == 0) {
|
} else if (strcmp(key, "focus_cross_tag") == 0) {
|
||||||
config->focus_cross_tag = atoi(value);
|
config->focus_cross_tag = atoi(value);
|
||||||
|
} else if (strcmp(key, "no_border_when_single") == 0) {
|
||||||
|
config->no_border_when_single= atoi(value);
|
||||||
} else if (strcmp(key, "snap_distance") == 0) {
|
} else if (strcmp(key, "snap_distance") == 0) {
|
||||||
config->snap_distance = atoi(value);
|
config->snap_distance = atoi(value);
|
||||||
} else if (strcmp(key, "enable_floating_snap") == 0) {
|
} else if (strcmp(key, "enable_floating_snap") == 0) {
|
||||||
|
|
@ -1673,6 +1676,7 @@ void override_config(void) {
|
||||||
scroller_focus_center = config.scroller_focus_center;
|
scroller_focus_center = config.scroller_focus_center;
|
||||||
focus_cross_monitor = config.focus_cross_monitor;
|
focus_cross_monitor = config.focus_cross_monitor;
|
||||||
focus_cross_tag = config.focus_cross_tag;
|
focus_cross_tag = config.focus_cross_tag;
|
||||||
|
no_border_when_single= config.no_border_when_single;
|
||||||
snap_distance = config.snap_distance;
|
snap_distance = config.snap_distance;
|
||||||
enable_floating_snap = config.enable_floating_snap;
|
enable_floating_snap = config.enable_floating_snap;
|
||||||
swipe_min_threshold = config.swipe_min_threshold;
|
swipe_min_threshold = config.swipe_min_threshold;
|
||||||
|
|
@ -1771,6 +1775,7 @@ void set_value_default() {
|
||||||
config.scroller_prefer_center = scroller_prefer_center;
|
config.scroller_prefer_center = scroller_prefer_center;
|
||||||
config.focus_cross_monitor = focus_cross_monitor;
|
config.focus_cross_monitor = focus_cross_monitor;
|
||||||
config.focus_cross_tag = focus_cross_tag;
|
config.focus_cross_tag = focus_cross_tag;
|
||||||
|
config.no_border_when_single= no_border_when_single;
|
||||||
config.snap_distance = snap_distance;
|
config.snap_distance = snap_distance;
|
||||||
config.enable_floating_snap = enable_floating_snap;
|
config.enable_floating_snap = enable_floating_snap;
|
||||||
config.swipe_min_threshold = swipe_min_threshold;
|
config.swipe_min_threshold = swipe_min_threshold;
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ int scroller_focus_center = 0;
|
||||||
int scroller_prefer_center = 0;
|
int scroller_prefer_center = 0;
|
||||||
int focus_cross_monitor = 0;
|
int focus_cross_monitor = 0;
|
||||||
int focus_cross_tag = 0;
|
int focus_cross_tag = 0;
|
||||||
|
int no_border_when_single = 0;
|
||||||
int snap_distance = 30;
|
int snap_distance = 30;
|
||||||
int enable_floating_snap = 0;
|
int enable_floating_snap = 0;
|
||||||
unsigned int cursor_size = 24;
|
unsigned int cursor_size = 24;
|
||||||
|
|
|
||||||
21
src/maomao.c
21
src/maomao.c
|
|
@ -1048,6 +1048,9 @@ void set_rect_size(struct wlr_scene_rect *rect, int width, int height) {
|
||||||
void apply_border(Client *c, struct wlr_box clip_box, int offsetx,
|
void apply_border(Client *c, struct wlr_box clip_box, int offsetx,
|
||||||
int offsety) {
|
int offsety) {
|
||||||
int i;
|
int i;
|
||||||
|
int num = 0;
|
||||||
|
Client *ec;
|
||||||
|
|
||||||
if (c->iskilling || !client_surface(c)->mapped)
|
if (c->iskilling || !client_surface(c)->mapped)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -1078,6 +1081,24 @@ void apply_border(Client *c, struct wlr_box clip_box, int offsetx,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(no_border_when_single) {
|
||||||
|
wl_list_for_each(ec, &clients, link) {
|
||||||
|
if (c->iskilling || !client_surface(c)->mapped)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (ec != c && ec->tags & c->mon->tagset[c->mon->seltags])
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (num == 0) {
|
||||||
|
set_rect_size(c->border[0], 0, 0);
|
||||||
|
set_rect_size(c->border[1], 0, 0);
|
||||||
|
set_rect_size(c->border[2], 0, 0);
|
||||||
|
set_rect_size(c->border[3], 0, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw);
|
wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw);
|
||||||
set_rect_size(c->border[0], clip_box.width, c->bw);
|
set_rect_size(c->border[0], clip_box.width, c->bw);
|
||||||
set_rect_size(c->border[1], clip_box.width, c->bw);
|
set_rect_size(c->border[1], clip_box.width, c->bw);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue