aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@users.noreply.github.com>2022-11-12 14:58:13 +0100
committerGitHub <noreply@github.com>2022-11-12 14:58:13 +0100
commit170a322cc2bc411257014943ad84c19cc4779e05 (patch)
treefac17b1182c74f2f68f1165320458c72e445ce86 /src
parentd1301262048592390ff2e8e3bbc2300cd77bd917 (diff)
downloadi3-170a322cc2bc411257014943ad84c19cc4779e05.tar.gz
i3-170a322cc2bc411257014943ad84c19cc4779e05.zip
fix: prevent gaps inside floating split containers (#5276)
Fixes https://github.com/i3/i3/issues/5272
Diffstat (limited to 'src')
-rw-r--r--src/con.c5
-rw-r--r--src/gaps.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/src/con.c b/src/con.c
index 5bf559a1..5ecc2700 100644
--- a/src/con.c
+++ b/src/con.c
@@ -618,7 +618,10 @@ bool con_is_docked(Con *con) {
*
*/
Con *con_inside_floating(Con *con) {
- assert(con != NULL);
+ if (con == NULL) {
+ return NULL;
+ }
+
if (con->type == CT_FLOATING_CON)
return con;
diff --git a/src/gaps.c b/src/gaps.c
index 545c8b65..a67e8ceb 100644
--- a/src/gaps.c
+++ b/src/gaps.c
@@ -52,6 +52,11 @@ bool gaps_should_inset_con(Con *con, int children) {
return false;
}
+ /* Floating split containers should never have gaps inside them. */
+ if (con_inside_floating(con)) {
+ return false;
+ }
+
const bool leaf_or_stacked_tabbed =
con_is_leaf(con) ||
(con->layout == L_STACKED || con->layout == L_TABBED);