smart_borders: Deprecate option (#5889)

This had pretty much identical behaviour to hide_edge_borders which made
it confusing. The `hide_edge_borders smart_no_gaps` implementation has an extra check
which fixes #5406.
This commit is contained in:
Orestis Floros 2024-01-30 08:53:32 +01:00 committed by GitHub
parent c3173af2f1
commit 230147c815
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 17 additions and 36 deletions

View File

@ -792,6 +792,10 @@ The "smart_no_gaps" setting hides edge-specific borders of a container if the
container is the only container on its workspace and the gaps to the screen edge
are +0+.
[[_smart_borders]]
+hide_edge_borders+ has replaced the old +smart_borders+ syntax. Use the former
instead of the latter.
*Syntax*:
-----------------------------------------------
hide_edge_borders none|vertical|horizontal|both|smart|smart_no_gaps
@ -802,27 +806,6 @@ hide_edge_borders none|vertical|horizontal|both|smart|smart_no_gaps
hide_edge_borders vertical
----------------------
[[_smart_borders]]
=== Smart borders
Smart borders will draw borders on windows only if there is more than one window
in a workspace. This feature can also be enabled only if the gap size between
window and screen edge is +0+.
*Syntax*:
-----------------------------------------------
smart_borders on|off|no_gaps
-----------------------------------------------
*Example*:
----------------------
# Activate smart borders (always)
smart_borders on
# Activate smart borders (only when there are effectively no gaps)
smart_borders no_gaps
----------------------
[[for_window]]
=== Arbitrary commands for specific windows (for_window)

View File

@ -272,9 +272,6 @@ struct Config {
/* Gap sizes */
gaps_t gaps;
/* Should single containers on a workspace receive a border? */
smart_borders_t smart_borders;
/* Disable gaps if there is only one container on the workspace */
smart_gaps_t smart_gaps;
};

View File

@ -81,10 +81,6 @@ typedef enum { ADJ_NONE = 0,
ADJ_UPPER_SCREEN_EDGE = (1 << 2),
ADJ_LOWER_SCREEN_EDGE = (1 << 4) } adjacent_t;
typedef enum { SMART_BORDERS_OFF,
SMART_BORDERS_ON,
SMART_BORDERS_NO_GAPS } smart_borders_t;
typedef enum { SMART_GAPS_OFF,
SMART_GAPS_ON,
SMART_GAPS_INVERSE_OUTER } smart_gaps_t;

View File

@ -0,0 +1 @@
deprecate smart_borders in favour of hide_edge_borders smart/smart_no_gaps

View File

@ -1824,9 +1824,7 @@ bool con_draw_decoration_into_frame(Con *con) {
}
static Rect con_border_style_rect_without_title(Con *con) {
if ((config.smart_borders == SMART_BORDERS_ON && con_num_visible_children(con_get_workspace(con)) <= 1) ||
(config.smart_borders == SMART_BORDERS_NO_GAPS && !has_outer_gaps(calculate_effective_gaps(con))) ||
(config.hide_edge_borders == HEBM_SMART && con_num_visible_children(con_get_workspace(con)) <= 1) ||
if ((config.hide_edge_borders == HEBM_SMART && con_num_visible_children(con_get_workspace(con)) <= 1) ||
(config.hide_edge_borders == HEBM_SMART_NO_GAPS && con_num_visible_children(con_get_workspace(con)) <= 1 && !has_outer_gaps(calculate_effective_gaps(con)))) {
if (!con_is_floating(con)) {
return (Rect){0, 0, 0, 0};

View File

@ -327,9 +327,15 @@ CFGFUN(gaps, const char *workspace, const char *scope, const long value) {
CFGFUN(smart_borders, const char *enable) {
if (!strcmp(enable, "no_gaps")) {
config.smart_borders = SMART_BORDERS_NO_GAPS;
} else {
config.smart_borders = boolstr(enable) ? SMART_BORDERS_ON : SMART_BORDERS_OFF;
config.hide_edge_borders = HEBM_SMART_NO_GAPS;
} else if (boolstr(enable)) {
if (config.hide_edge_borders == HEBM_NONE) {
/* Only enable this if hide_edge_borders is at the default value as it otherwise takes precedence */
config.hide_edge_borders = HEBM_SMART;
} else {
ELOG("Both hide_edge_borders and smart_borders was used. "
"Ignoring smart_borders as it is deprecated.\n");
}
}
}
@ -808,12 +814,12 @@ static void bar_configure_binding(const char *button, const char *release, const
}
CFGFUN(bar_wheel_up_cmd, const char *command) {
ELOG("'wheel_up_cmd' is deprecated. Please us 'bindsym button4 %s' instead.\n", command);
ELOG("'wheel_up_cmd' is deprecated. Please use 'bindsym button4 %s' instead.\n", command);
bar_configure_binding("button4", NULL, command);
}
CFGFUN(bar_wheel_down_cmd, const char *command) {
ELOG("'wheel_down_cmd' is deprecated. Please us 'bindsym button5 %s' instead.\n", command);
ELOG("'wheel_down_cmd' is deprecated. Please use 'bindsym button5 %s' instead.\n", command);
bar_configure_binding("button5", NULL, command);
}