Salut,
Je suis entrain d'écrire un petit window manager pour le fun... Pratiquement tout est fonctionnel, mais je rencontre un problème lors de la fermeture des programmes.
Quand je ferme un programme, la fenêtre la contenant se ferme correctement, mais le processus est toujours actif (même si j'utilise le menu fichier/quitter dudit programme).
Voici mon pstree après avoir fermé plusieurs urxvt:
Voici ma fonction de spawn:Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 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] <-- LA PARTIE INTERESSANTE! │ └─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
Voici ma fonction permettant de tuer un client:Code:
1
2
3
4
5
6
7
8
9
10 static void spawn(const char **command) { if(fork() == 0) { if(dis) close(ConnectionNumber(dis)); setsid(); execvp((char*)command[0],(char**)command); exit(0); } }
Et le destroy notify handler:Code:
1
2
3
4 void kill_client() { if(current != NULL) XDestroyWindow(dis,current->win); }
Et si besoin est, le reste du code ce trouve la: http://github.com/pyknite/catwmCode:
1
2
3
4
5
6
7 static void destroynotify(XEvent *e) { XDestroyWindowEvent *ev = &e->xdestroywindow; remove_window(ev->window); tile(); update_current(); }
Merci d'avance ;)