From 0208df5d1cb5aa319a5db713c2a322a1401ca70f Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 13 May 2007 23:16:17 +0000 Subject: [PATCH] merge r6494-6502 from trunk --- Makefile.am | 2 + data/rc-gnome.xml | 546 +++++++++++++++++++++++++ data/rc-kde.xml | 546 +++++++++++++++++++++++++ data/xsession/openbox-gnome-session.in | 1 + data/xsession/openbox-kde-session.in | 1 + doc/openbox-gnome-session.1.sgml | 3 + doc/openbox-kde-session.1.sgml | 3 + doc/openbox.1.in | 23 +- doc/openbox.1.sgml | 18 +- openbox/event.c | 2 + openbox/openbox.c | 39 +- openbox/openbox.h | 1 + openbox/session.c | 18 +- openbox/startupnotify.c | 5 +- 14 files changed, 1178 insertions(+), 30 deletions(-) create mode 100644 data/rc-gnome.xml create mode 100644 data/rc-kde.xml diff --git a/Makefile.am b/Makefile.am index 85d6ce53..8b9f2fb5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -342,6 +342,8 @@ dist_pixmap_DATA = \ dist_rc_DATA = \ data/rc.xml \ + data/rc-gnome.xml \ + data/rc-kde.xml \ data/menu.xml edit = $(SED) \ diff --git a/data/rc-gnome.xml b/data/rc-gnome.xml new file mode 100644 index 00000000..20b20c51 --- /dev/null +++ b/data/rc-gnome.xml @@ -0,0 +1,546 @@ + + + + + + + + 10 + 20 + + + + yes + yes + no + 200 + no + + + + Smart + + + + + Clearlooks + NLIMC + yes + + yes + yes + + sans + 8 + + bold + + normal + + + + sans + 8 + + bold + + normal + + + + sans + 9 + + normal + + normal + + + + sans + 9 + + normal + + normal + + + + sans + 9 + + bold + + normal + + + + + + + 4 + 1 + + desktop one + desktop two + desktop three + desktop four + + + + + yes + Nonpixel + + Center + + + + + TopLeft + + 0 + 0 + no + Above + + Vertical + + no + 300 + + 300 + + Middle + + + + + C-g + + + + no + + + no + + + no + + + no + + + no + + + no + + + no + + + no + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + + + + + + + + + + + client-menu + + + + + + + + + + + + yesyes + + + + + + + + true + Konqueror + + kfmclient openProfile filemanagement + + + + + + 3 + + 200 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + client-menu + + + + + + + + + top + + + + + + + + + bottom + + + + + + + + + + + client-menu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + client-menu + + + + client-menu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + menu.xml + 200 + no + 100 + yes + + + + + + + + + + yes + + no + + + + center + + 200 + + 1 + + + + yes + + + 1 + + + normal + + + no + + no + + + no + + + yes + + true + + + + --> + + diff --git a/data/rc-kde.xml b/data/rc-kde.xml new file mode 100644 index 00000000..20b20c51 --- /dev/null +++ b/data/rc-kde.xml @@ -0,0 +1,546 @@ + + + + + + + + 10 + 20 + + + + yes + yes + no + 200 + no + + + + Smart + + + + + Clearlooks + NLIMC + yes + + yes + yes + + sans + 8 + + bold + + normal + + + + sans + 8 + + bold + + normal + + + + sans + 9 + + normal + + normal + + + + sans + 9 + + normal + + normal + + + + sans + 9 + + bold + + normal + + + + + + + 4 + 1 + + desktop one + desktop two + desktop three + desktop four + + + + + yes + Nonpixel + + Center + + + + + TopLeft + + 0 + 0 + no + Above + + Vertical + + no + 300 + + 300 + + Middle + + + + + C-g + + + + no + + + no + + + no + + + no + + + no + + + no + + + no + + + no + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + + + + + + + + + + + client-menu + + + + + + + + + + + + yesyes + + + + + + + + true + Konqueror + + kfmclient openProfile filemanagement + + + + + + 3 + + 200 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + client-menu + + + + + + + + + top + + + + + + + + + bottom + + + + + + + + + + + client-menu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + client-menu + + + + client-menu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + menu.xml + 200 + no + 100 + yes + + + + + + + + + + yes + + no + + + + center + + 200 + + 1 + + + + yes + + + 1 + + + normal + + + no + + no + + + no + + + yes + + true + + + + --> + + diff --git a/data/xsession/openbox-gnome-session.in b/data/xsession/openbox-gnome-session.in index c2bc9399..b5223552 100644 --- a/data/xsession/openbox-gnome-session.in +++ b/data/xsession/openbox-gnome-session.in @@ -2,4 +2,5 @@ # Run GNOME with Openbox as its window manager export WINDOW_MANAGER="@bindir@/openbox" +export OPENBOX_CONFIG_NAMESPACE="gnome" exec gnome-session "$@" diff --git a/data/xsession/openbox-kde-session.in b/data/xsession/openbox-kde-session.in index 0fe00940..a125e4cd 100644 --- a/data/xsession/openbox-kde-session.in +++ b/data/xsession/openbox-kde-session.in @@ -2,4 +2,5 @@ # Run KDE with Openbox as its window manager export KDEWM="@bindir@/openbox" +export OPENBOX_CONFIG_NAMESPACE="kde" exec startkde "$@" diff --git a/doc/openbox-gnome-session.1.sgml b/doc/openbox-gnome-session.1.sgml index b86e1b87..702fab70 100644 --- a/doc/openbox-gnome-session.1.sgml +++ b/doc/openbox-gnome-session.1.sgml @@ -38,6 +38,9 @@ manpage.1: manpage.sgml &dhpackage; runs a GNOME session with Openbox as the window manager. + + When running inside GNOME like this, Openbox will use the + rc-gnome.xml configuration file. SEE ALSO diff --git a/doc/openbox-kde-session.1.sgml b/doc/openbox-kde-session.1.sgml index 4de8c024..d481ff02 100644 --- a/doc/openbox-kde-session.1.sgml +++ b/doc/openbox-kde-session.1.sgml @@ -38,6 +38,9 @@ manpage.1: manpage.sgml &dhpackage; runs a KDE session with Openbox as the window manager. + + When running inside KDE like this, Openbox will use the + rc-kde.xml configuration file. SEE ALSO diff --git a/doc/openbox.1.in b/doc/openbox.1.in index 9782d0e3..f8979751 100644 --- a/doc/openbox.1.in +++ b/doc/openbox.1.in @@ -4,7 +4,7 @@ openbox \(em Next generation, highly configurable window manager .SH "SYNOPSIS" .PP -\fBopenbox\fR [\fB\-\-help\fP] [\fB\-\-version\fP] [\fB\-\-replace\fP] [\fB\-\-reconfigure\fP] [\fB\-\-sm-disable\fP] [\fB\-\-config \fITYPE\fR\fP] [\fB\-\-sync\fP] [\fB\-\-debug\fP] [\fB\-\-debug-focus\fP] +\fBopenbox\fR [\fB\-\-help\fP] [\fB\-\-version\fP] [\fB\-\-replace\fP] [\fB\-\-reconfigure\fP] [\fB\-\-sm-disable\fP] [\fB\-\-sync\fP] [\fB\-\-debug\fP] [\fB\-\-debug-focus\fP] .SH "DESCRIPTION" .PP Openbox is a next generation, highly @@ -41,10 +41,17 @@ above ~/.xsession file. You can use the \fBobconf\fR tool to configure Openbox easily with a graphical interface, however more in-depth configuration is possible by editing the configuration files by hand. The default -configuration file is installed in @configdir@/openbox/rc.xml, and the -user configuration is placed in ~/.config/openbox/rc.xml. You can copy +configuration files are installed in @configdir@/openbox/, and the +user configuration is placed in ~/.config/openbox/. You can copy the default configuration to ~/.config/openbox and edit it to your liking. +.PP +There are 3 default configuration files, \fBrc.xml\fP, +\fBrc-gnome.xml\fP, and \fBrc-kde.xml\fP. The +rc-gnome.xml is used when you run +\fBopenbox-gnome-session\fR and the rc-kde.xml is used when +you run \fBopenbox-kde-session\fR. The configuration +files should be named the same in ~/.config/openbox/. .SH "OPTIONS" .PP These are the possible options that \fBopenbox\fR accepts: @@ -59,8 +66,6 @@ If Openbox is already running on the display, tell it to reload it's configuration. .IP "\fB\-\-sm-disable\fP" 10 Do not connect to the session manager. -.IP "\fB\-\-config\fITYPE\fR\fP" 10 -Specify the configuration profile to use. .IP "\fB\-\-sync\fP" 10 Run in synchronous mode (for debugging). .IP "\fB\-\-debug\fP" 10 @@ -77,4 +82,12 @@ The program's full documentation is available on the website: .PP Please report bugs to: \fBhttp://bugzilla.icculus.org/ \fP +<<<<<<< .working +<<<<<<< .working .\" created by instant / docbook-to-man, Sun 13 May 2007, 17:59 +======= +.\" created by instant / docbook-to-man, Sun 13 May 2007, 19:06 +>>>>>>> .merge-right.r6502 +======= +.\" created by instant / docbook-to-man, Sun 13 May 2007, 19:06 +>>>>>>> .merge-right.r6502 diff --git a/doc/openbox.1.sgml b/doc/openbox.1.sgml index b2b4a836..2a619526 100644 --- a/doc/openbox.1.sgml +++ b/doc/openbox.1.sgml @@ -41,7 +41,6 @@ manpage.1: manpage.sgml - @@ -81,11 +80,18 @@ manpage.1: manpage.sgml You can use the obconf tool to configure Openbox easily with a graphical interface, however more in-depth configuration is possible by editing the configuration files by hand. The default - configuration file is installed in @configdir@/openbox/rc.xml, and the - user configuration is placed in ~/.config/openbox/rc.xml. You can copy + configuration files are installed in @configdir@/openbox/, and the + user configuration is placed in ~/.config/openbox/. You can copy the default configuration to ~/.config/openbox and edit it to your liking. + There are 3 default configuration files, rc.xml, + rc-gnome.xml, and rc-kde.xml. The + rc-gnome.xml is used when you run + openbox-gnome-session and the rc-kde.xml is used when + you run openbox-kde-session. The configuration + files should be named the same in ~/.config/openbox/. + OPTIONS @@ -123,12 +129,6 @@ manpage.1: manpage.sgml Do not connect to the session manager. - - - - Specify the configuration profile to use. - - diff --git a/openbox/event.c b/openbox/event.c index 3acb5d1f..c8b7e6dc 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -573,6 +573,8 @@ static void event_process(const XEvent *ec, gpointer data) if (client && !nomove) { frame_adjust_focus(client->frame, FALSE); + if (client == focus_client) + focus_set_client(NULL); /* focus_set_client has already been called for sure */ client_calc_layer(client); } diff --git a/openbox/openbox.c b/openbox/openbox.c index 2de1f7e7..0f2ba923 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -89,6 +89,7 @@ gboolean ob_replace_wm = FALSE; gboolean ob_sm_use = TRUE; gchar *ob_sm_id = NULL; gchar *ob_sm_save_file = NULL; +gchar *ob_config_type = NULL; static ObState state; static gboolean xsync = FALSE; @@ -100,10 +101,10 @@ static KeyCode keys[OB_NUM_KEYS]; static gint exitcode = 0; static guint remote_control = 0; static gboolean being_replaced = FALSE; -static gchar *config_type = NULL; static void signal_handler(gint signal, gpointer data); static void remove_args(gint *argc, gchar **argv, gint index, gint num); +static void parse_env(); static void parse_args(gint *argc, gchar **argv); static Cursor load_cursor(const gchar *name, guint fontval); @@ -126,6 +127,8 @@ gint main(gint argc, gchar **argv) /* parse the command line args, which can change the argv[0] */ parse_args(&argc, argv); + /* parse the environment variables */ + parse_env(); program_name = g_path_get_basename(argv[0]); g_set_prgname(program_name); @@ -234,15 +237,15 @@ gint main(gint argc, gchar **argv) config_startup(i); /* parse/load user options */ - if (parse_load_rc(config_type, &doc, &node)) { + if (parse_load_rc(ob_config_type, &doc, &node)) { parse_tree(i, doc, node->xmlChildrenNode); parse_close(doc); } else g_message(_("Unable to find a valid config file, using some simple defaults")); - if (config_type != NULL) + if (ob_config_type != NULL) PROP_SETS(RootWindow(ob_display, ob_screen), - ob_config, config_type); + ob_config, ob_config_type); /* we're done with parsing now, kill it */ parse_shutdown(i); @@ -405,6 +408,10 @@ gint main(gint argc, gchar **argv) argv = nargv; } + /* we also remove some environment variables, so put them back */ + if (ob_config_type) + setenv("OPENBOX_CONFIG_NAMESPACE", ob_config_type, 1); + /* re-run me */ execvp(argv[0], argv); /* try how we were run */ execlp(argv[0], program_name, (gchar*)NULL); /* last resort */ @@ -413,7 +420,7 @@ gint main(gint argc, gchar **argv) /* free stuff passed in from the command line or environment */ g_free(ob_sm_save_file); g_free(ob_sm_id); - g_free(config_type); + g_free(ob_config_type); g_free(program_name); return exitcode; @@ -461,7 +468,6 @@ static void print_help() g_print(_(" --version Display the version and exit\n")); g_print(_(" --replace Replace the currently running window manager\n")); g_print(_(" --sm-disable Disable connection to the session manager\n")); - g_print(_(" --config TYPE Specify the configuration profile to use\n")); g_print(_("\nPassing messages to a running Openbox instance:\n")); g_print(_(" --reconfigure Reload Openbox's configuration\n")); g_print(_("\nDebugging options:\n")); @@ -482,6 +488,15 @@ static void remove_args(gint *argc, gchar **argv, gint index, gint num) *argc -= num; } +static void parse_env() +{ + /* unset this so we don't pass it on unknowingly */ + unsetenv("DESKTOP_STARTUP_ID"); + + if (getenv("OPENBOX_CONFIG_NAMESPACE")) + ob_config_type = g_strdup(getenv("OPENBOX_CONFIG_NAMESPACE")); +} + static void parse_args(gint *argc, gchar **argv) { gint i; @@ -524,12 +539,16 @@ static void parse_args(gint *argc, gchar **argv) remote_control = 2; */ } - else if (!strcmp(argv[i], "--config")) { + else if (!strcmp(argv[i], "--config-namespace")) { if (i == *argc - 1) /* no args left */ - g_printerr(_("--config requires an argument\n")); + /* not translated cuz it's sekret */ + g_printerr("--config-namespace requires an argument\n"); else { - config_type = g_strdup(argv[i+1]); - ++i; + ob_config_type = g_strdup(argv[i+1]); + remove_args(argc, argv, i, 2); + --i; /* this arg was removed so go back */ + ob_debug_type(OB_DEBUG_SM, "--config-namespace %s\n", + ob_sm_save_file); } } else if (!strcmp(argv[i], "--sm-save-file")) { diff --git a/openbox/openbox.h b/openbox/openbox.h index fadb6981..b5d722e9 100644 --- a/openbox/openbox.h +++ b/openbox/openbox.h @@ -46,6 +46,7 @@ extern gchar *ob_sm_id; make a new file every time, yay. */ extern gchar *ob_sm_save_file; extern gboolean ob_replace_wm; +extern gchar *ob_config_type; /* The state of execution of the window manager */ ObState ob_state(); diff --git a/openbox/session.c b/openbox/session.c index b07f1694..7a9a081d 100644 --- a/openbox/session.c +++ b/openbox/session.c @@ -319,12 +319,15 @@ static void session_setup_clone_command() static void session_setup_restart_command() { gint i; + gint num = 4; - SmPropValue *vals = g_new(SmPropValue, sm_argc + 4); + if (ob_config_type) num += 2; + + SmPropValue *vals = g_new(SmPropValue, sm_argc + num); SmProp prop = { .name = g_strdup(SmRestartCommand), .type = g_strdup(SmLISTofARRAY8), - .num_vals = sm_argc + 4, + .num_vals = sm_argc + num, .vals = vals }; SmProp *list = ∝ @@ -350,11 +353,22 @@ static void session_setup_restart_command() ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i+2].value); ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i+3].value); + if (ob_config_type) { + vals[i+4].value = g_strdup("--config-namespace"); + vals[i+4].length = strlen("--config-namespace") + 1; + vals[i+5].value = ob_config_type; + vals[i+5].length = strlen(ob_config_type) + 1; + ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i+4].value); + ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i+5].value); + } + SmcSetProperties(sm_conn, 1, &list); g_free(prop.name); g_free(prop.type); g_free(vals[i].value); g_free(vals[i+2].value); + if (ob_config_type) + g_free(vals[i+4].value); g_free(vals); } diff --git a/openbox/startupnotify.c b/openbox/startupnotify.c index 03cb752b..45a2b4c2 100644 --- a/openbox/startupnotify.c +++ b/openbox/startupnotify.c @@ -24,10 +24,7 @@ #ifndef USE_LIBSN -void sn_startup(gboolean reconfig) { - /* unset this so we don't pass it on unknowingly */ - if (!reconfig) unsetenv("DESKTOP_STARTUP_ID"); -} +void sn_startup(gboolean reconfig) {} void sn_shutdown(gboolean reconfig) {} gboolean sn_app_starting() { return FALSE; } Time sn_app_started(const gchar *id, const gchar *wmclass) -- 2.34.1