From: Michael Stapelberg Date: Fri, 1 May 2009 14:10:02 +0000 (+0200) Subject: Bugfix: Correctly restart i3 when not using its absolute path X-Git-Tag: 3.a-bf1~16 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e91f399609ea9aadb913a29e3515313101094460;p=i3%2Fi3 Bugfix: Correctly restart i3 when not using its absolute path --- diff --git a/debian/changelog b/debian/changelog index d6041d77..a090ebd4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,7 @@ i3-wm (3.a-bf1-1) unstable; urgency=low etc. * Bugfix: Correctly update state when moving fullscreen windows across workspaces. + * Bugfix: Correctly restart i3 when not using its absolute path * Implement scrolling on stack windows and on the bottom bar. * Create i3-wm-dbg with debug symbols * Don't rely on libxcb-wm any longer, as it got removed in libxcb 0.3.4. diff --git a/include/i3.h b/include/i3.h index 6d6f9d74..a3dfc4c0 100644 --- a/include/i3.h +++ b/include/i3.h @@ -22,7 +22,7 @@ #define NUM_ATOMS 12 -extern char *application_path; +extern char **start_argv; extern Display *xkbdpy; extern TAILQ_HEAD(bindings_head, Binding) bindings; extern SLIST_HEAD(stack_wins_head, Stack_Window) stack_wins; diff --git a/src/commands.c b/src/commands.c index 9f5be8dc..f3e31a3a 100644 --- a/src/commands.c +++ b/src/commands.c @@ -607,8 +607,8 @@ void parse_command(xcb_connection_t *conn, const char *command) { /* Is it ? Then restart in place. */ if (STARTS_WITH(command, "restart")) { - LOG("restarting \"%s\"...\n", application_path); - execl(application_path, application_path, NULL); + LOG("restarting \"%s\"...\n", start_argv[0]); + execvp(start_argv[0], start_argv); /* not reached */ } diff --git a/src/mainx.c b/src/mainx.c index 34daf04e..03390f90 100644 --- a/src/mainx.c +++ b/src/mainx.c @@ -44,7 +44,7 @@ #include "xinerama.h" /* This is the path to i3, copied from argv[0] when starting up */ -char *application_path; +char **start_argv; /* This is our connection to X11 for use with XKB */ Display *xkbdpy; @@ -338,7 +338,7 @@ int main(int argc, char *argv[], char *env[]) { if (!isatty(fileno(stdout))) setbuf(stdout, NULL); - application_path = sstrdup(argv[0]); + start_argv = argv; while ((opt = getopt(argc, argv, "c:v")) != -1) { switch (opt) {