summaryrefslogtreecommitdiff
path: root/openbox/openbox.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-06 08:32:03 +0000
committerDana Jansens <danakj@orodu.net>2007-05-06 08:32:03 +0000
commit277db2822d79a6000d31b93ec963ae87286d6ade (patch)
treed7221420025a7e745145c200bac43ba6b1e01e4c /openbox/openbox.c
parent007e62fa7722cafcd5344976cb4b621931eae3b0 (diff)
a bunch of thigns got squashed into this commit.. sorry..
1. soem bug fixes for window stacking 2. clarify some functions behavior with their names 3. add (untested) support for legacy fullscreen apps. i have no idea what they do on a multihead xinerama setup though and if this would help there or need some changes.
Diffstat (limited to 'openbox/openbox.c')
-rw-r--r--openbox/openbox.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/openbox/openbox.c b/openbox/openbox.c
index 63379641..8b54e70b 100644
--- a/openbox/openbox.c
+++ b/openbox/openbox.c
@@ -379,19 +379,27 @@ gint main(gint argc, gchar **argv)
}
/* we remove the session arguments from argv, so put them back */
- if (ob_sm_save_file != NULL) {
- guint l = g_strv_length(argv);
- argv = g_renew(gchar*, argv, l+2);
- argv[l] = g_strdup("--sm-save-file");
- argv[l+1] = ob_sm_save_file;
- argv[l+2] = NULL;
- }
- if (ob_sm_id != NULL) {
- guint l = g_strv_length(argv);
- argv = g_renew(gchar*, argv, l+2);
- argv[l] = g_strdup("--sm-client-id");
- argv[l+1] = ob_sm_id;
- argv[l+2] = NULL;
+ if (ob_sm_save_file != NULL || ob_sm_id != NULL) {
+ gchar **nargv;
+ gint i, l;
+
+ l = argc +
+ (ob_sm_save_file != NULL ? 2 : 0) +
+ (ob_sm_id != NULL ? 2 : 0);
+ nargv = g_new0(gchar*, l+1);
+ for (i = 0; i < argc; ++i)
+ nargv[i] = argv[i];
+
+ if (ob_sm_save_file != NULL) {
+ nargv[i++] = g_strdup("--sm-save-file");
+ nargv[i++] = ob_sm_save_file;
+ }
+ if (ob_sm_id != NULL) {
+ nargv[i++] = g_strdup("--sm-client-id");
+ nargv[i++] = ob_sm_id;
+ }
+ g_assert(i == l);
+ argv = nargv;
}
/* re-run me */