4 * ROX-Filer, filer for the ROX desktop project
5 * By Thomas Leonard, <tal197@ecs.soton.ac.uk>.
14 #include <collection.h>
16 #include "gui_support.h"
25 /* XXX: Maybe we shouldn't do so much work in a signal handler? */
26 static void child_died(int signum
)
30 FilerWindow
*filer_window
;
32 /* Find out which children exited. This also has the effect of
33 * allowing the children to die.
37 child
= waitpid(-1, &status
, WNOHANG
| WUNTRACED
);
39 if (child
== 0 || child
== -1)
42 filer_window
= g_hash_table_lookup(child_to_filer
,
45 scan_dir(filer_window
);
47 if (!WIFSTOPPED(status
))
48 g_hash_table_remove(child_to_filer
,
54 int main(int argc
, char **argv
)
56 gtk_init(&argc
, &argv
);
57 choices_init("ROX-Filer");
67 signal(SIGCHLD
, child_died
);
70 filer_opendir(getenv("HOME"), FALSE
, BOTTOM
);
74 gboolean panel
= FALSE
;
79 if (argv
[i
][0] == '-')
81 switch (argv
[i
][1] + (argv
[i
][2] << 8))
83 case 't': side
= TOP
; break;
84 case 'b': side
= BOTTOM
; break;
85 case 'l': side
= LEFT
; break;
86 case 'r': side
= RIGHT
; break;
96 filer_opendir(argv
[i
], panel
, side
);