1
0
mirror of https://github.com/0intro/wmii synced 2025-03-13 10:13:45 +03:00

added wmiisetsid (to prevent annoyances with broken p9p apps)

This commit is contained in:
Anselm R. Garbe 2006-05-15 01:20:24 +02:00
parent ad3197184e
commit b14a2ad536
5 changed files with 46 additions and 6 deletions

@ -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

@ -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)

@ -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}

36
cmd/wmiisetsid.c Normal file

@ -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;
}

@ -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--)