4 * ROX-Filer, filer for the ROX desktop project
5 * By Thomas Leonard, <tal197@ecs.soton.ac.uk>.
14 #include <collection.h>
17 #include "gui_support.h"
27 int number_of_windows
= 0; /* Quit when this reaches 0 again... */
29 /* XXX: Maybe we shouldn't do so much work in a signal handler? */
30 static void child_died(int signum
)
34 FilerWindow
*filer_window
;
36 /* Find out which children exited. This also has the effect of
37 * allowing the children to die.
41 child
= waitpid(-1, &status
, WNOHANG
| WUNTRACED
);
43 if (child
== 0 || child
== -1)
46 filer_window
= g_hash_table_lookup(child_to_filer
,
49 scan_dir(filer_window
);
51 if (!WIFSTOPPED(status
))
52 g_hash_table_remove(child_to_filer
,
58 int main(int argc
, char **argv
)
60 gtk_init(&argc
, &argv
);
61 choices_init("ROX-Filer");
74 signal(SIGCHLD
, child_died
);
77 filer_opendir(getenv("HOME"), FALSE
, BOTTOM
);
81 gboolean panel
= FALSE
;
86 if (argv
[i
][0] == '-')
88 switch (argv
[i
][1] + (argv
[i
][2] << 8))
90 case 't': side
= TOP
; break;
91 case 'b': side
= BOTTOM
; break;
92 case 'l': side
= LEFT
; break;
93 case 'r': side
= RIGHT
; break;
103 filer_opendir(argv
[i
], panel
, side
);