On execwm, we should properly release resources before exec'ing into a

new window manager; so allow CWM_EXEC_WM to assign new wm to wm_argv and
pass through cwm_status (now EXECWM) so that x_teardown() gets called
before exec'ing the new window manager.  Removes the need for a separate
x_restart() now, using new wm_argv; and consolidates errno for execvp.
This commit is contained in:
okan
2015-09-16 17:58:25 +00:00
parent 47a10cc055
commit 0fdcf3f3df
5 changed files with 39 additions and 20 deletions

View File

@ -325,8 +325,9 @@ kbfunc_exec(struct client_ctx *cc, union arg *arg)
u_spawn(mi->text);
break;
case CWM_EXEC_WM:
u_exec(mi->text);
warn("%s", mi->text);
cwm_status = CWM_EXECWM;
free(wm_argv);
wm_argv = xstrdup(mi->text);
break;
default:
errx(1, "kb_func: egad, cmd changed value!");