- /* 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 {
+ Window reconfig_window;
+ Popup *reconfig_popup;
+
+ if (reconfigure) {
+ gint w, h;
+
+ w = WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen));
+ h = HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen));
+
+ reconfig_popup = popup_new(FALSE);
+ popup_position(reconfig_popup, CenterGravity, w / 2, h / 2);
+ popup_show(reconfig_popup, _("Reloading . . ."), NULL);
+
+ reconfig_window = XCreateWindow
+ (ob_display, RootWindow(ob_display, ob_screen),
+ 0, 0, w, h,
+ 0, CopyFromParent, InputOnly, CopyFromParent, 0, NULL);
+ XMapWindow(ob_display, reconfig_window);
+
+ XFlush(ob_display);
+ }
+
+ 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 */
+ {
+ RrTheme *theme;
+ if ((theme = RrThemeNew(ob_rr_inst, config_theme)))
+ ob_rr_theme = theme;
+ if (ob_rr_theme == NULL)
+ ob_exit_with_error("Unable to load a theme.");
+ }