commit 073a7d71e11c71eb728d01cd1750f056b0c1a16c
parent 3cbe80f265c32a2b9a7a228885d5668204ddddfa
Author: phillbush <phillbush@cock.li>
Date: Tue, 28 Sep 2021 19:28:16 -0300
fix deletion from focuslist/raiselist; fix shodc
Diffstat:
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/shod.c b/shod.c
@@ -2224,14 +2224,16 @@ containerdecorate(struct Container *c, struct Column *cdiv, struct Row *rdiv, in
static void
containerdelfocus(struct Container *c)
{
- if (c->fnext) {
+ if (c->fnext != NULL) {
c->fnext->fprev = c->fprev;
}
- if (c->fprev) {
+ if (c->fprev != NULL) {
c->fprev->fnext = c->fnext;
} else if (wm.focuslist == c) {
wm.focuslist = c->fnext;
}
+ c->fnext = NULL;
+ c->fprev = NULL;
}
/* put container on beginning of focus list */
@@ -2406,10 +2408,10 @@ containerconfigure(struct Container *c, unsigned int valuemask, XWindowChanges *
static void
containerdelraise(struct Container *c)
{
- if (c->rnext) {
+ if (c->rnext != NULL) {
c->rnext->rprev = c->rprev;
}
- if (c->rprev) {
+ if (c->rprev != NULL) {
c->rprev->rnext = c->rnext;
} else if (wm.fulllist == c) {
wm.fulllist = c->rnext;
@@ -2420,6 +2422,8 @@ containerdelraise(struct Container *c)
} else if (wm.belowlist == c) {
wm.belowlist = c->rnext;
}
+ c->rnext = NULL;
+ c->rprev = NULL;
}
/* put container on beginning of a raise list */
diff --git a/shodc.c b/shodc.c
@@ -418,7 +418,7 @@ setgeom(int argc, char *argv[])
rel = 0;
x = y = w = h = 0;
- while ((c = getopt(argc, argv, "XYWHxywh")) != -1) {
+ while ((c = getopt(argc, argv, "X:Y:W:H:x:y:w:h:")) != -1) {
switch (c) {
case 'X':
rel |= _SHOD_RELATIVE_X;