Implement pid->workspace tracking

When you spawn a process with the exec command, sway now notes the
workspace you had focused and the pid of the child process, then assigns
that workspace to the child when its window appears.

Some of this is carried over from sway 0.15, but with some major
refactoring and centralization of state.
This commit is contained in:
Drew DeVault 2018-06-26 20:32:09 -04:00
parent 62a7b762ac
commit acd79e1505
10 changed files with 154 additions and 33 deletions

View file

@ -76,7 +76,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
waitpid(pid, NULL, 0);
if (*child > 0) {
wlr_log(L_DEBUG, "Child process created with pid %d", *child);
// TODO: add PID to active workspace
workspace_record_pid(*child);
} else {
free(child);
}