aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-16 08:09:59 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-16 08:09:59 -0400
commit76ec9422a66c4ff59dc0590d80f7f6e931fd8e1a (patch)
tree914b01d7f01ea8b90397041dce2437305453aba2 /sway/container.c
parent5ed999b1101e5a5830461f56977950232a6c8106 (diff)
parenteefc76b39e61ce04fa8ac0e732a22c10d9c98e1f (diff)
Merge pull request #38 from taiyu-len/master
get/set_userdata stores swayc_t *, fixed memory leak, minor changes.
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sway/container.c b/sway/container.c
index 98941b2c..ff9c983a 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -31,6 +31,9 @@ static void free_swayc(swayc_t *c) {
}
remove_child(c->parent, c);
}
+ if (c->name) {
+ free(c->name);
+ }
free(c);
}
@@ -51,8 +54,10 @@ swayc_t *new_output(wlc_handle handle) {
output->height = size->h;
output->handle = handle;
- add_child(&root_container, output);
+ //link this to handler
+ wlc_handle_set_user_data(handle, output);
+ add_child(&root_container, output);
//TODO something with this
int total_width = 0;
container_map(&root_container, add_output_widths, &total_width);
@@ -135,6 +140,8 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) {
view->name = strdup(title);
view->visible = true;
+ //Link view to handle
+ wlc_handle_set_user_data(handle, view);
//Case of focused workspace, just create as child of it
if (sibling->type == C_WORKSPACE) {
add_child(sibling, view);