X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fopenbox.c;h=631395cc826b522c428d113bf149f1070e1e5085;hb=c90da6da781932c2d178bfb7e39ec1d5003543b7;hp=62b08db7e5ef73977e210d9de47cf1be7b6af098;hpb=04a44af3c4d6365cbf7b551b9cc15eaaada28410;p=chaz%2Fopenbox diff --git a/openbox/openbox.c b/openbox/openbox.c index 62b08db7..631395cc 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -13,6 +13,8 @@ #include "focus.h" #include "moveresize.h" #include "frame.h" +#include "keyboard.h" +#include "mouse.h" #include "extensions.h" #include "grab.h" #include "plugin.h" @@ -67,8 +69,6 @@ static gchar *sm_save_file; static void signal_handler(const ObEvent *e, void *data); static void parse_args(int argc, char **argv); -static void exit_with_error(gchar *msg); - int main(int argc, char **argv) { struct sigaction action; @@ -130,11 +130,12 @@ int main(int argc, char **argv) ob_display = XOpenDisplay(NULL); if (ob_display == NULL) - exit_with_error("Failed to open the display."); + ob_exit_with_error("Failed to open the display."); if (fcntl(ConnectionNumber(ob_display), F_SETFD, 1) == -1) - exit_with_error("Failed to set display as close-on-exec."); + ob_exit_with_error("Failed to set display as close-on-exec."); - session_load(sm_save_file); + if (sm_save_file) + session_load(sm_save_file); session_startup(argc, argv); #ifdef USE_LIBSN @@ -145,7 +146,7 @@ int main(int argc, char **argv) ob_rr_inst = RrInstanceNew(ob_display, ob_screen); if (ob_rr_inst == NULL) - exit_with_error("Failed to initialize the render library."); + ob_exit_with_error("Failed to initialize the render library."); /* XXX fork self onto other screens */ @@ -237,13 +238,15 @@ int main(int argc, char **argv) /* load the theme specified in the rc file */ ob_rr_theme = RrThemeNew(ob_rr_inst, config_theme); if (ob_rr_theme == NULL) - exit_with_error("Unable to load a theme."); + ob_exit_with_error("Unable to load a theme."); moveresize_startup(); screen_startup(); group_startup(); client_startup(); dock_startup(); + keyboard_startup(); + mouse_startup(); /* call startup for all the plugins */ plugin_startall(); @@ -260,6 +263,8 @@ int main(int argc, char **argv) client_unmanage_all(); plugin_shutdown(); /* calls all the plugins' shutdown functions */ + mouse_shutdown(); + keyboard_shutdown(); dock_shutdown(); client_shutdown(); group_shutdown(); @@ -403,7 +408,7 @@ static void parse_args(int argc, char **argv) } } -static void exit_with_error(gchar *msg) +void ob_exit_with_error(gchar *msg) { g_critical(msg); session_shutdown();