From 0f1859ed25741927117b31cdd3ef2560f0327688 Mon Sep 17 00:00:00 2001 From: Zandr Martin Date: Mon, 6 Jun 2016 06:58:53 -0500 Subject: messy, unfinished version --- include/config.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') 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; -- cgit v1.2.3 From 03d79b41c71f091f61f4712963a3760fd24fdb62 Mon Sep 17 00:00:00 2001 From: Zandr Martin Date: Fri, 10 Jun 2016 06:08:59 -0500 Subject: semi-working (only non-client/server wayland apps) --- include/util.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') 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 +#include #include #include @@ -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 -- cgit v1.2.3 From beaa03344eda931274b75275bfc2d622e6875956 Mon Sep 17 00:00:00 2001 From: Zandr Martin Date: Sat, 11 Jun 2016 09:20:09 -0500 Subject: clean up pid/workspace stuff --- include/workspace.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') 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 +#include #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 -- cgit v1.2.3 From 2298143d09ce8810d9772f95e1cb605fb6b08536 Mon Sep 17 00:00:00 2001 From: Zandr Martin Date: Sat, 11 Jun 2016 12:43:34 -0500 Subject: cleanup + add timeouts for pid_workspace list --- include/config.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/config.h b/include/config.h index 35797ac2..bf278ddb 100644 --- a/include/config.h +++ b/include/config.h @@ -1,11 +1,14 @@ #ifndef _SWAY_CONFIG_H #define _SWAY_CONFIG_H +#define PID_WORKSPACE_TIMEOUT 60 + #include #include #include #include #include +#include #include "wayland-desktop-shell-server-protocol.h" #include "list.h" #include "layout.h" @@ -95,8 +98,10 @@ struct workspace_output { struct pid_workspace { pid_t *pid; char *workspace; + time_t *time_added; }; +void pid_workspace_add(struct pid_workspace *pw); void free_pid_workspace(struct pid_workspace *pw); struct bar_config { -- cgit v1.2.3