aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-11-24 10:12:08 -0500
committerDrew DeVault <sir@cmpwn.com>2015-11-24 10:12:08 -0500
commite7c0573a980938a5174bc647faf41f24fa523b0b (patch)
treec73a877a83807b4b1f707a039aaee392d14bab6d /sway/container.c
parentc671329681550e0b92aabafd284f9c508511714e (diff)
parent4367e6d3e306f81e113d61842c3c542d62694577 (diff)
Merge pull request #249 from sce/extra_view_metadata
Extra view metadata
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/container.c b/sway/container.c
index bbe2e7b0..1634cce0 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -50,6 +50,12 @@ static void free_swayc(swayc_t *cont) {
if (cont->name) {
free(cont->name);
}
+ if (cont->class) {
+ free(cont->class);
+ }
+ if (cont->app_id) {
+ free(cont->app_id);
+ }
free(cont);
}
@@ -214,6 +220,10 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) {
// Setup values
view->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
@@ -246,6 +256,10 @@ swayc_t *new_floating_view(wlc_handle handle) {
// Setup values
view->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