diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 8 | ||||
-rw-r--r-- | include/util.h | 8 | ||||
-rw-r--r-- | include/workspace.h | 2 |
3 files changed, 18 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h index d591daf2..35797ac2 100644 --- a/include/config.h +++ b/include/config.h @@ -92,6 +92,13 @@ struct workspace_output { char *workspace; }; +struct pid_workspace { + pid_t *pid; + char *workspace; +}; + +void free_pid_workspace(struct pid_workspace *pw); + struct bar_config { /** * One of "dock", "hide", "invisible" @@ -175,6 +182,7 @@ struct sway_config { list_t *bars; list_t *cmd_queue; list_t *workspace_outputs; + list_t *pid_workspaces; list_t *output_configs; list_t *input_configs; list_t *criteria; diff --git a/include/util.h b/include/util.h index dc47e343..6f21bff0 100644 --- a/include/util.h +++ b/include/util.h @@ -2,6 +2,7 @@ #define _SWAY_UTIL_H #include <stdint.h> +#include <unistd.h> #include <wlc/wlc.h> #include <xkbcommon/xkbcommon.h> @@ -36,4 +37,11 @@ const char *get_modifier_name_by_mask(uint32_t modifier); */ int get_modifier_names(const char **names, uint32_t modifier_masks); +/** + * Get the pid of a parent process given the pid of a child process. + * + * Returns the parent pid or NULL if the parent pid cannot be determined. + */ +pid_t get_parent_pid(pid_t pid); + #endif diff --git a/include/workspace.h b/include/workspace.h index 6911e3d4..c268fafa 100644 --- a/include/workspace.h +++ b/include/workspace.h @@ -2,6 +2,7 @@ #define _SWAY_WORKSPACE_H #include <wlc/wlc.h> +#include <unistd.h> #include "list.h" #include "layout.h" @@ -16,5 +17,6 @@ swayc_t *workspace_output_next(); swayc_t *workspace_next(); swayc_t *workspace_output_prev(); swayc_t *workspace_prev(); +swayc_t *workspace_for_pid(pid_t pid); #endif |