You are not logged in.
Pages: 1
Hi there,
I'm writting a very simple tiling window manager. It's almost working, but I still have a problem when I close or kill a program
The window containing the program is correctly closed but the program still working (even if I close the program via the file menu).
For example see this pstree:
init─┬─acpid
├─4*[agetty]
├─bluetoothd
├─crond
├─2*[dbus-daemon]
├─dbus-launch
├─dhcpcd
├─firefox───18*[{firefox}]
├─gconfd-2
├─hald───hald-runner─┬─hald-addon-acpi
│ ├─hald-addon-gene
│ ├─hald-addon-inpu
│ ├─hald-addon-leds
│ ├─hald-addon-rfki
│ └─hald-addon-stor
├─httpd───11*[httpd]
├─login───bash───startx───xinit─┬─X
│ └─scrotwm
├─login───bash───startx───xinit─┬─X
│ └─catwm─┬─setxkbmap
│ ├─5*[urxvt───bash] <-- THIS IS THE INTERESTING PART!!
│ └─xsetbg
├─mpd───3*[{mpd}]
├─mysqld_safe───mysqld───8*[{mysqld}]
├─ntpd
├─proftpd
├─screen─┬─bash───ncmpc
│ ├─bash───irssi
│ ├─bash───java───16*[{java}]
│ ├─bash───vim
│ └─bash───pstree
├─syslog-ng───syslog-ng
├─udevd───2*[udevd]
└─urxvt───bash───screen
I have closed all urxvt, except one to make the pstree, but we can see that other urxvt still work
Here is my spawn function:
static void spawn(const char **command) {
if(fork() == 0) {
if(dis)
close(ConnectionNumber(dis));
setsid();
execvp((char*)command[0],(char**)command);
exit(0);
}
}
Here my kill client:
void kill_client() {
if(current != NULL)
XDestroyWindow(dis,current->win);
}
And the destroynotify handler:
static void destroynotify(XEvent *e) {
XDestroyWindowEvent *ev = &e->xdestroywindow;
remove_window(ev->window);
tile();
update_current();
}
And you can see the rest of the code here: http://github.com/pyknite/catwm
Thx for the help
Last edited by pyknite (2010-03-15 20:07:39)
Offline
Ok, problem solved... I found the solution while reading some code
Offline
Pages: 1