X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fopenbox.c;h=ff226af4dcf30a72b815e08170d8247f59b3a0c0;hb=2b80e4e8ef56bb4fba614139601e750344418e5b;hp=b69f2c1e41fac5d08be5544dd9bd4a31140dc0f5;hpb=44be67844a5568e8b1ad87327b0815f8667151c0;p=chaz%2Fopenbox diff --git a/openbox/openbox.c b/openbox/openbox.c index b69f2c1e..ff226af4 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -28,6 +28,7 @@ #include "xerror.h" #include "prop.h" #include "screen.h" +#include "actions.h" #include "startupnotify.h" #include "focus.h" #include "focus_cycle.h" @@ -41,7 +42,6 @@ #include "menuframe.h" #include "grab.h" #include "group.h" -#include "propwin.h" #include "config.h" #include "mainloop.h" #include "gettext.h" @@ -128,7 +128,7 @@ gint main(gint argc, gchar **argv) if (chdir(g_get_home_dir()) == -1) g_message(_("Unable to change to home directory '%s': %s"), g_get_home_dir(), g_strerror(errno)); - + /* parse the command line args, which can change the argv[0] */ parse_args(&argc, argv); /* parse the environment variables */ @@ -154,7 +154,7 @@ gint main(gint argc, gchar **argv) prop_startup(); /* Send client message telling the OB process to: - * remote_control = 1 -> reconfigure + * remote_control = 1 -> reconfigure * remote_control = 2 -> restart */ PROP_MSG(RootWindow(ob_display, ob_screen), ob_control, remote_control, 0, 0, 0); @@ -177,7 +177,7 @@ gint main(gint argc, gchar **argv) ob_rr_inst = RrInstanceNew(ob_display, ob_screen); if (ob_rr_inst == NULL) - ob_exit_with_error(_("Failed to initialize the render library.")); + ob_exit_with_error(_("Failed to initialize the obrender library.")); XSynchronize(ob_display, xsync); @@ -238,6 +238,8 @@ gint main(gint argc, gchar **argv) of the rc */ i = parse_startup(); + /* register all the available actions */ + actions_startup(reconfigure); /* start up config which sets up with the parser */ config_startup(i); @@ -261,7 +263,7 @@ gint main(gint argc, gchar **argv) /* load the theme specified in the rc file */ { RrTheme *theme; - if ((theme = RrThemeNew(ob_rr_inst, config_theme, + if ((theme = RrThemeNew(ob_rr_inst, config_theme, TRUE, config_font_activewindow, config_font_inactivewindow, config_font_menutitle, @@ -273,6 +275,9 @@ gint main(gint argc, gchar **argv) } if (ob_rr_theme == NULL) ob_exit_with_error(_("Unable to load a theme.")); + + PROP_SETS(RootWindow(ob_display, ob_screen), + ob_theme, ob_rr_theme->name); } if (reconfigure) { @@ -295,7 +300,6 @@ gint main(gint argc, gchar **argv) sn_startup(reconfigure); screen_startup(reconfigure); grab_startup(reconfigure); - propwin_startup(reconfigure); group_startup(reconfigure); client_startup(reconfigure); dock_startup(reconfigure); @@ -327,10 +331,14 @@ gint main(gint argc, gchar **argv) /* redecorate all existing windows */ for (it = client_list; it; it = g_list_next(it)) { ObClient *c = it->data; + /* the new config can change the window's decorations */ - client_setup_decor_and_functions(c); + client_setup_decor_and_functions(c, FALSE); /* redraw the frames */ frame_adjust_area(c->frame, TRUE, TRUE, FALSE); + /* the decor sizes may have changed, so the windows may + end up in new positions */ + client_reconfigure(c, FALSE); } } @@ -353,7 +361,6 @@ gint main(gint argc, gchar **argv) dock_shutdown(reconfigure); client_shutdown(reconfigure); group_shutdown(reconfigure); - propwin_shutdown(reconfigure); grab_shutdown(reconfigure); screen_shutdown(reconfigure); focus_cycle_popup_shutdown(reconfigure); @@ -364,6 +371,7 @@ gint main(gint argc, gchar **argv) window_shutdown(reconfigure); event_shutdown(reconfigure); config_shutdown(); + actions_shutdown(reconfigure); modkeys_shutdown(reconfigure); } while (reconfigure); } @@ -432,7 +440,7 @@ gint main(gint argc, gchar **argv) g_free(ob_sm_save_file); g_free(ob_sm_id); g_free(program_name); - + return exitcode; } @@ -445,7 +453,7 @@ static void signal_handler(gint signal, gpointer data) break; case SIGUSR2: ob_debug("Caught signal %d. Reconfiguring.\n", signal); - ob_reconfigure(); + ob_reconfigure(); break; case SIGCHLD: /* reap children */ @@ -481,6 +489,7 @@ static void print_help() g_print(_("\nPassing messages to a running Openbox instance:\n")); g_print(_(" --reconfigure Reload Openbox's configuration\n")); g_print(_(" --restart Restart Openbox\n")); + g_print(_(" --exit Exit Openbox\n")); g_print(_("\nDebugging options:\n")); g_print(_(" --sync Run in synchronous mode\n")); g_print(_(" --debug Display debugging output\n")); @@ -503,7 +512,9 @@ static void remove_args(gint *argc, gchar **argv, gint index, gint num) static void parse_env() { /* unset this so we don't pass it on unknowingly */ - unsetenv("DESKTOP_STARTUP_ID"); + gchar *s = g_strdup("DESKTOP_STARTUP_ID"); + putenv(s); + g_free(s); } static void parse_args(gint *argc, gchar **argv) @@ -546,9 +557,13 @@ static void parse_args(gint *argc, gchar **argv) } else if (!strcmp(argv[i], "--reconfigure")) { remote_control = 1; - } else if (!strcmp(argv[i], "--restart")) { + } + else if (!strcmp(argv[i], "--restart")) { remote_control = 2; } + else if (!strcmp(argv[i], "--exit")) { + remote_control = 3; + } else if (!strcmp(argv[i], "--sm-save-file")) { if (i == *argc - 1) /* no args left */ /* not translated cuz it's sekret */