wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit b14a2ad53657968d020250d3a8246388771e2406
parent ad3197184e0a892d6692a56160be48be6ba8dd7b
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Mon, 15 May 2006 01:20:24 +0200

added wmiisetsid (to prevent annoyances with broken p9p apps)


Diffstat:
Makefile | 3++-
TODO.wmii-4 | 7++++---
cmd/Makefile | 2+-
cmd/wmiisetsid.c | 36++++++++++++++++++++++++++++++++++++
liblitz/font.c | 4+++-
5 files changed, 46 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile @@ -5,7 +5,8 @@ include config.mk SUBDIRS = libcext liblitz libixp cmd -BIN = cmd/wm/wmii cmd/wm/wmiiwm cmd/wmiimenu cmd/wmiipsel cmd/wmiir cmd/wmiiwarp +BIN = cmd/wm/wmii cmd/wm/wmiiwm cmd/wmiimenu cmd/wmiipsel \ + cmd/wmiir cmd/wmiisetsid cmd/wmiiwarp MAN1 = cmd/wm/wmii.1 cmd/wm/wmiiwm.1 \ cmd/wmiimenu.1 cmd/wmiir.1 diff --git a/TODO.wmii-4 b/TODO.wmii-4 @@ -1,8 +1,5 @@ Ordered list of TODOs: -- introduce wmiisetsid to prevent crashes of not-setsid'ing processes like acme - which send SIGHUP to the complete process group (oh dear, Uriel that is really - retarded behavior by p9p) - introduce empty views - apply the focuscolor patch by Stefan Tibus - remove swapping action, merge vertical swapping into moving - is this a good idea? @@ -38,3 +35,7 @@ Ordered list of TODOs: - partial EWMH support - libixp: idea from PoP: implement a va_args method similiar to printf for marshalling 9P messages, might reduce LOC drastically +- an SDL window requests that it should not be allowed to be + resized, wmii still allows the user to resize it! + (a good idea would be to make all windows that set that hint floating windows) + diff --git a/cmd/Makefile b/cmd/Makefile @@ -6,7 +6,7 @@ include ../config.mk CFLAGS += -I../liblitz -I../libixp -I../libcext LDFLAGS += -L../liblitz -llitz -L../libixp -lixp -L../libcext -lcext -SRC = wmiimenu.c wmiipsel.c wmiir.c wmiiwarp.c +SRC = wmiimenu.c wmiipsel.c wmiir.c wmiisetsid.c wmiiwarp.c OBJ = ${SRC:.c=.o} all: ${OBJ} diff --git a/cmd/wmiisetsid.c b/cmd/wmiisetsid.c @@ -0,0 +1,36 @@ +/* + * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> + * See LICENSE file for license details. + */ +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> + +int +main(int argc, char *argv[]) +{ + if(argc < 2) { + fprintf(stderr, "usage: wmiisetsid cmd [arg ...]\n", argv[0]); + exit(1); + } + if(getpgrp() == getpid()) { + switch(fork()){ + case -1: + perror("wmiisetsid: fork"); + exit(1); + case 0: + break; + default: + exit(0); + } + } + if(setsid() < 0) { + perror("wmiisetsid: setsid"); + exit(1); + } + execvp(argv[1], argv + 1); + perror("wmiisetsid: execvp"); + exit(1); + return 0; +} + diff --git a/liblitz/font.c b/liblitz/font.c @@ -33,7 +33,9 @@ blitz_loadfont(Display *dpy, BlitzFont *font, char *fontstr) if(font->set) XFreeFontSet(dpy, font->set); font->set = nil; - if(!loc || !strncmp(loc, "C", 2) || !strncmp(loc, "POSIX", 6)|| !XSupportsLocale()) { + if(!loc || !strncmp(loc, "C", 2) || !strncmp(loc, "POSIX", 6) || + !XSupportsLocale()) + { font->set = XCreateFontSet(dpy, fontname, &missing, &n, &def); if(missing) { while(n--)