diff --git a/src/config/parse_config.h b/src/config/parse_config.h index fb5986fc..4356f612 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -95,6 +95,7 @@ typedef struct { int32_t force_tearing; int32_t noswallow; int32_t noblur; + int32_t canvas_notile; float focused_opacity; float unfocused_opacity; float scroller_proportion_single; @@ -316,6 +317,7 @@ typedef struct { uint32_t borderpx; int32_t canvas_tiling; int32_t canvas_tiling_gap; + int32_t canvas_pan_on_kill; float scratchpad_width_ratio; float scratchpad_height_ratio; float rootcolor[4]; @@ -1719,6 +1721,8 @@ bool parse_option(Config *config, char *key, char *value) { config->canvas_tiling = atoi(value); } else if (strcmp(key, "canvas_tiling_gap") == 0) { config->canvas_tiling_gap = atoi(value); + } else if (strcmp(key, "canvas_pan_on_kill") == 0) { + config->canvas_pan_on_kill = atoi(value); } else if (strcmp(key, "rootcolor") == 0) { int64_t color = parse_color(value); if (color == -1) { @@ -2091,6 +2095,7 @@ bool parse_option(Config *config, char *key, char *value) { rule->force_tearing = -1; rule->noswallow = -1; rule->noblur = -1; + rule->canvas_notile = -1; rule->nofocus = -1; rule->nofadein = -1; rule->nofadeout = -1; @@ -2210,6 +2215,8 @@ bool parse_option(Config *config, char *key, char *value) { rule->noswallow = atoi(val); } else if (strcmp(key, "noblur") == 0) { rule->noblur = atoi(val); + } else if (strcmp(key, "canvas_notile") == 0) { + rule->canvas_notile = atoi(val); } else if (strcmp(key, "scroller_proportion") == 0) { rule->scroller_proportion = atof(val); } else if (strcmp(key, "isfullscreen") == 0) { @@ -3360,6 +3367,7 @@ void set_value_default() { config.borderpx = 4; config.canvas_tiling = 0; config.canvas_tiling_gap = 10; + config.canvas_pan_on_kill = 1; config.overviewgappi = 5; config.overviewgappo = 30; config.cursor_hide_timeout = 0; diff --git a/src/layout/canvas.h b/src/layout/canvas.h index 6dcd30eb..f58e26e2 100644 --- a/src/layout/canvas.h +++ b/src/layout/canvas.h @@ -55,7 +55,8 @@ static void canvas_geom_init(Client *c, Monitor *m, uint32_t tag, float pan_x, int tiling = config.canvas_tiling; - if (tiling > 0 && !client_is_float_type(c) && !client_get_parent(c)) { + if (tiling > 0 && !client_is_float_type(c) && !client_get_parent(c) && + !c->is_in_scratchpad && !c->isnamedscratchpad && !c->canvas_notile) { Client *focused = NULL, *tmp; wl_list_for_each(tmp, &fstack, flink) { if (tmp == c || tmp->iskilling || tmp->isunglobal) diff --git a/src/mango.c b/src/mango.c index c8d7deaa..ec4ec93f 100644 --- a/src/mango.c +++ b/src/mango.c @@ -412,6 +412,7 @@ struct Client { float unfocused_opacity; char oldmonname[128]; int32_t noblur; + int32_t canvas_notile; double master_mfact_per, master_inner_per, stack_inner_per; double old_master_mfact_per, old_master_inner_per, old_stack_inner_per; double old_scroller_pproportion; @@ -1443,6 +1444,7 @@ static void apply_rule_properties(Client *c, const ConfigWinRule *r) { APPLY_INT_PROP(c, r, indleinhibit_when_focus); APPLY_INT_PROP(c, r, isunglobal); APPLY_INT_PROP(c, r, noblur); + APPLY_INT_PROP(c, r, canvas_notile); APPLY_INT_PROP(c, r, allow_shortcuts_inhibit); APPLY_FLOAT_PROP(c, r, scroller_proportion); @@ -4273,6 +4275,7 @@ void init_client_properties(Client *c) { c->noswallow = 0; c->isterm = 0; c->noblur = 0; + c->canvas_notile = 0; c->tearing_hint = 0; c->overview_isfullscreenbak = 0; c->overview_ismaximizescreenbak = 0; @@ -6965,7 +6968,7 @@ void unmapnotify(struct wl_listener *listener, void *data) { if (nextfocus) { focusclient(nextfocus, 0); - if (selmon && is_canvas_layout(selmon)) + if (config.canvas_pan_on_kill && selmon && is_canvas_layout(selmon)) canvas_pan_to_client(selmon, nextfocus); }