- /* startup the parsing so everything can register sections of the rc */
- parse_startup();
-
- /* anything that is going to read data from the rc file needs to be
- in this group */
- timer_startup();
- event_startup();
- grab_startup();
- /* focus_backup is used for stacking, so this needs to come before
- anything that calls stacking_add */
- focus_startup();
- window_startup();
- plugin_startup();
- /* load the plugins specified in the pluginrc */
- plugin_loadall();
-
- /* set up the kernel config shit */
- config_startup();
- menu_startup();
- /* parse/load user options */
- if (parse_load_rc(&doc, &node))
- parse_tree(doc, node->xmlChildrenNode, NULL);
- /* we're done with parsing now, kill it */
- parse_shutdown();
-
- /* 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.");
-
- moveresize_startup();
- screen_startup();
- group_startup();
- client_startup();
- dock_startup();
-
- /* call startup for all the plugins */
- plugin_startall();
-
- /* get all the existing windows */
- client_manage_all();
-
- state = OB_STATE_RUNNING;
- while (!shutdown)
- event_loop();
- state = OB_STATE_EXITING;
-
- dock_remove_all();
- client_unmanage_all();
-
- plugin_shutdown(); /* calls all the plugins' shutdown functions */
- dock_shutdown();
- client_shutdown();
- group_shutdown();
- screen_shutdown();
- focus_shutdown();
- moveresize_shutdown();
- menu_shutdown();
- window_shutdown();
- grab_shutdown();
- event_shutdown();
- timer_shutdown();
- config_shutdown();
- }
+ do {
+ event_startup(reconfigure);
+ grab_startup(reconfigure);
+ /* focus_backup is used for stacking, so this needs to come before
+ anything that calls stacking_add */
+ focus_startup(reconfigure);
+ window_startup(reconfigure);
+ sn_startup(reconfigure);
+
+ {
+ ObParseInst *i;
+ xmlDocPtr doc;
+ xmlNodePtr node;
+
+ /* startup the parsing so everything can register sections
+ of the rc */
+ i = parse_startup();
+
+ config_startup(i);
+ /* parse/load user options */
+ if (parse_load_rc(&doc, &node))
+ parse_tree(i, doc, node->xmlChildrenNode);
+ /* we're done with parsing now, kill it */
+ xmlFreeDoc(doc);
+ parse_shutdown(i);
+ }
+
+ /* load the theme specified in the rc file */
+ ob_rr_theme = RrThemeNew(ob_rr_inst, config_theme);
+ if (ob_rr_theme == NULL)
+ ob_exit_with_error("Unable to load a theme.");
+
+ moveresize_startup(reconfigure);
+ screen_startup(reconfigure);
+ group_startup(reconfigure);
+ client_startup(reconfigure);
+ dock_startup(reconfigure);
+ keyboard_startup(reconfigure);
+ mouse_startup(reconfigure);
+ menu_startup(reconfigure);
+
+ if (!reconfigure) {
+ /* get all the existing windows */
+ client_manage_all();
+ } else {
+ GList *it;
+
+ /* redecorate all existing windows */
+ for (it = client_list; it; it = g_list_next(it)) {
+ ObClient *c = it->data;
+ frame_adjust_theme(c->frame);
+ }
+ }