shod

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit fa565af5324ddd27fb351f7d29d3f7977661f9f4
parent 64884ba4e717126d7c4bdda521b645a786f4c7cf
Author: seninha <lucas@seninha.org>
Date:   Tue, 15 Feb 2022 08:52:20 -0300

fix placement of new container; remove -lXpm

Diffstat:
MMakefile | 2+-
Mshod.c | 3+++
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -8,7 +8,7 @@ X11LIB = /usr/X11R6/lib # includes and libs INCS = -I${LOCALINC} -I${X11INC} -LIBS = -L${LOCALLIB} -L${X11LIB} -lX11 -lXinerama -lXpm -lXrender +LIBS = -L${LOCALLIB} -L${X11LIB} -lX11 -lXinerama -lXrender # flags CFLAGS = -g -O0 -Wall -Wextra ${INCS} ${CPPFLAGS} diff --git a/shod.c b/shod.c @@ -2030,6 +2030,8 @@ containerplace(struct Container *c, struct Desktop *desk, int userplaced) } c->nw = max(wm.minsize, w); c->nh = max(wm.minsize, h); + c->nx = max(mon->wx, min(mon->wx + mon->ww - c->nw, c->nx)); + c->ny = max(mon->wy, min(mon->wy + mon->wh - c->nh, c->ny)); /* if the user placed the window, we should not re-place it */ if (userplaced) @@ -5007,6 +5009,7 @@ managecontainer(struct Container *c, struct Tab *t, struct Desktop *desk, int us coladdrow(col, row, NULL); rowaddtab(row, t, NULL); containersendtodesk(c, desk, 1, userplaced); + containercalccols(c, 1, 1); containermoveresize(c); containerredecorate(c, NULL, NULL, 0); XMapSubwindows(dpy, c->frame);