From 47c313fe3e8f66dafbebd4d00c143ac4a49c5c2d Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Sun, 22 Nov 2015 22:05:00 +0100 Subject: container: Store class attribute for views. --- include/container.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/container.h') diff --git a/include/container.h b/include/container.h index cb18de49..c2953eec 100644 --- a/include/container.h +++ b/include/container.h @@ -75,7 +75,9 @@ struct sway_container { bool is_floating; bool is_focused; + // Attributes that mostly views have. char *name; + char *class; int gaps; -- cgit v1.2.3-70-g09d2 From 4367e6d3e306f81e113d61842c3c542d62694577 Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Sun, 22 Nov 2015 22:09:33 +0100 Subject: container: Store app_id attribute for views. --- include/container.h | 1 + sway/container.c | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'include/container.h') diff --git a/include/container.h b/include/container.h index c2953eec..7b0bdb78 100644 --- a/include/container.h +++ b/include/container.h @@ -78,6 +78,7 @@ struct sway_container { // Attributes that mostly views have. char *name; char *class; + char *app_id; int gaps; diff --git a/sway/container.c b/sway/container.c index 5bf59c26..1634cce0 100644 --- a/sway/container.c +++ b/sway/container.c @@ -53,6 +53,9 @@ static void free_swayc(swayc_t *cont) { if (cont->class) { free(cont->class); } + if (cont->app_id) { + free(cont->app_id); + } free(cont); } @@ -219,6 +222,8 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) { view->name = title ? strdup(title) : NULL; const char *class = wlc_view_get_class(handle); view->class = class ? strdup(class) : NULL; + const char *app_id = wlc_view_get_app_id(handle); + view->app_id = app_id ? strdup(app_id) : NULL; view->visible = true; view->is_focused = true; // Setup geometry @@ -253,6 +258,8 @@ swayc_t *new_floating_view(wlc_handle handle) { view->name = title ? strdup(title) : NULL; const char *class = wlc_view_get_class(handle); view->class = class ? strdup(class) : NULL; + const char *app_id = wlc_view_get_app_id(handle); + view->app_id = app_id ? strdup(app_id) : NULL; view->visible = true; // Set the geometry of the floating view -- cgit v1.2.3-70-g09d2