diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 7f547f3..ce4d8ef 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -491,6 +491,8 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value, char *arg_v func = restore_minized; } else if (strcmp(func_name, "toggle_scratchpad") == 0) { func = toggle_scratchpad; + } else if (strcmp(func_name, "toggle_render_border") == 0) { + func = toggle_render_border; } else if (strcmp(func_name, "focusmon") == 0) { func = focusmon; (*arg).i = parse_direction(arg_value); diff --git a/src/dispatch/dispatch.h b/src/dispatch/dispatch.h index f378d48..e18e03e 100644 --- a/src/dispatch/dispatch.h +++ b/src/dispatch/dispatch.h @@ -53,4 +53,5 @@ void togglefakefullscreen(const Arg *arg); void toggleoverlay(const Arg *arg); void movewin(const Arg *arg); void resizewin(const Arg *arg); -void toggle_named_scratch(const Arg *arg); \ No newline at end of file +void toggle_named_scratch(const Arg *arg); +void toggle_render_border(const Arg *arg); \ No newline at end of file diff --git a/src/maomao.c b/src/maomao.c index a881981..94c0556 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -702,6 +702,8 @@ static uint32_t swipe_fingers = 0; static double swipe_dx = 0; static double swipe_dy = 0; +bool render_border = true; + /* global event handlers */ static struct zdwl_ipc_manager_v2_interface dwl_manager_implementation = { .release = dwl_ipc_manager_release, @@ -1056,6 +1058,14 @@ void apply_border(Client *c, struct wlr_box clip_box, int offsetx, if (c->iskilling || !client_surface(c)->mapped) return; + if(!render_border) { + 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); set_rect_size(c->border[0], clip_box.width, c->bw); set_rect_size(c->border[1], clip_box.width, c->bw); @@ -1450,6 +1460,11 @@ bool switch_scratch_client_state(Client *c) { return false; } +void toggle_render_border(const Arg *arg) { + render_border = !render_border; + arrange(selmon, false); +} + void toggle_named_scratch(const Arg *arg) { Client *c = NULL; Client *target_client = NULL;