From 277db2822d79a6000d31b93ec963ae87286d6ade Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 6 May 2007 08:32:03 +0000 Subject: 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. --- openbox/openbox.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'openbox/openbox.c') 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 */ -- cgit v1.2.3