diff options
author | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-11-22 22:09:33 +0100 |
---|---|---|
committer | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-11-24 16:00:41 +0100 |
commit | 4367e6d3e306f81e113d61842c3c542d62694577 (patch) | |
tree | c73a877a83807b4b1f707a039aaee392d14bab6d | |
parent | container: Store class attribute for views. (diff) | |
download | sway-4367e6d3e306f81e113d61842c3c542d62694577.tar.gz sway-4367e6d3e306f81e113d61842c3c542d62694577.tar.zst sway-4367e6d3e306f81e113d61842c3c542d62694577.zip |
container: Store app_id attribute for views.
-rw-r--r-- | include/container.h | 1 | ||||
-rw-r--r-- | sway/container.c | 7 |
2 files changed, 8 insertions, 0 deletions
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 { | |||
78 | // Attributes that mostly views have. | 78 | // Attributes that mostly views have. |
79 | char *name; | 79 | char *name; |
80 | char *class; | 80 | char *class; |
81 | char *app_id; | ||
81 | 82 | ||
82 | int gaps; | 83 | int gaps; |
83 | 84 | ||
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) { | |||
53 | if (cont->class) { | 53 | if (cont->class) { |
54 | free(cont->class); | 54 | free(cont->class); |
55 | } | 55 | } |
56 | if (cont->app_id) { | ||
57 | free(cont->app_id); | ||
58 | } | ||
56 | free(cont); | 59 | free(cont); |
57 | } | 60 | } |
58 | 61 | ||
@@ -219,6 +222,8 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) { | |||
219 | view->name = title ? strdup(title) : NULL; | 222 | view->name = title ? strdup(title) : NULL; |
220 | const char *class = wlc_view_get_class(handle); | 223 | const char *class = wlc_view_get_class(handle); |
221 | view->class = class ? strdup(class) : NULL; | 224 | view->class = class ? strdup(class) : NULL; |
225 | const char *app_id = wlc_view_get_app_id(handle); | ||
226 | view->app_id = app_id ? strdup(app_id) : NULL; | ||
222 | view->visible = true; | 227 | view->visible = true; |
223 | view->is_focused = true; | 228 | view->is_focused = true; |
224 | // Setup geometry | 229 | // Setup geometry |
@@ -253,6 +258,8 @@ swayc_t *new_floating_view(wlc_handle handle) { | |||
253 | view->name = title ? strdup(title) : NULL; | 258 | view->name = title ? strdup(title) : NULL; |
254 | const char *class = wlc_view_get_class(handle); | 259 | const char *class = wlc_view_get_class(handle); |
255 | view->class = class ? strdup(class) : NULL; | 260 | view->class = class ? strdup(class) : NULL; |
261 | const char *app_id = wlc_view_get_app_id(handle); | ||
262 | view->app_id = app_id ? strdup(app_id) : NULL; | ||
256 | view->visible = true; | 263 | view->visible = true; |
257 | 264 | ||
258 | // Set the geometry of the floating view | 265 | // Set the geometry of the floating view |