X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fopenbox.c;h=6645f5bbf8bf9e2d899fbe8f51675a42d6bb9e67;hb=5bf68f762b8fc87cf5583b645b948b4fe55f179f;hp=a4f527b1824690ac6f61731459cc58ece0104dae;hpb=178fdf254d35c7af40ee5f09e7ade9d2fcdc5ec5;p=chaz%2Fopenbox diff --git a/openbox/openbox.c b/openbox/openbox.c index a4f527b1..6645f5bb 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -8,6 +8,7 @@ #include "focus.h" #include "extensions.h" #include "gettext.h" +#include "config.h" #include "grab.h" #include "engine.h" #include "themerc.h" @@ -19,9 +20,6 @@ #ifdef HAVE_FCNTL_H # include #endif -#ifdef HAVE_SYS_SELECT_H -# include -#endif #ifdef HAVE_SIGNAL_H # include #endif @@ -38,6 +36,10 @@ #ifdef HAVE_UNISTD_H # include #endif +#ifdef HAVE_SYS_STAT_H +# include +# include +#endif #include @@ -60,6 +62,7 @@ int main(int argc, char **argv) { struct sigaction action; sigset_t sigset; + char *path; ob_state = State_Starting; @@ -78,7 +81,7 @@ int main(int argc, char **argv) sigemptyset(&sigset); action.sa_handler = dispatch_signal; action.sa_mask = sigset; - action.sa_flags = SA_NOCLDSTOP | SA_NODEFER; + action.sa_flags = SA_NOCLDSTOP; sigaction(SIGUSR1, &action, (struct sigaction *) NULL); sigaction(SIGPIPE, &action, (struct sigaction *) NULL); sigaction(SIGSEGV, &action, (struct sigaction *) NULL); @@ -90,6 +93,12 @@ int main(int argc, char **argv) /* anything that died while we were restarting won't give us a SIGCHLD */ while (waitpid(-1, NULL, WNOHANG) > 0); + + /* create the ~/.openbox dir */ + path = g_build_filename(g_get_home_dir(), ".openbox", NULL); + mkdir(path, (S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | + S_IROTH | S_IWOTH | S_IXOTH)); + g_free(path); /* parse out command line args */ parse_args(argc, argv); @@ -135,23 +144,25 @@ int main(int argc, char **argv) if (screen_annex()) { /* it will be ours! */ timer_startup(); + config_startup(); render_startup(); font_startup(); - themerc_startup(); - engine_startup(themerc_engine); + plugin_startup(); + + /* load the plugins specified in the pluginrc */ + plugin_loadall(); + /* parse/load user options */ + config_parse(); + + engine_startup(); event_startup(); screen_startup(); focus_startup(); client_startup(); grab_startup(); - plugin_startup(); - /* XXX load all plugins!! */ - plugin_open("focus"); - plugin_open("keyboard"); - plugin_open("mouse"); - plugin_open("placement"); - plugin_open("resistance"); + /* call startup for all the plugins */ + plugin_startall(); /* get all the existing windows */ client_manage_all(); @@ -172,6 +183,7 @@ int main(int argc, char **argv) engine_shutdown(); themerc_shutdown(); render_shutdown(); + config_shutdown(); timer_shutdown(); }