diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-08-09 20:40:29 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-08-09 20:40:52 -0400 |
commit | 2b1a0728b8a37ae8551df29574ddcf5d01f99199 (patch) | |
tree | 06738548f3642a98eccde5ee8b823159a06db272 | |
parent | 56d29bbec5acf76275722ec501249bf165106815 (diff) | |
download | sway-2b1a0728b8a37ae8551df29574ddcf5d01f99199.tar.xz |
Keep track of window names
-rw-r--r-- | sway/layout.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/layout.c b/sway/layout.c index 7dbe686a..2913daa9 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -116,6 +116,9 @@ void init_layout() { void free_swayc(swayc_t *container) { // NOTE: Does not handle moving children into a different container list_free(container->children); + if (container->name) { + free(container->name); + } free(container); } @@ -147,13 +150,14 @@ swayc_t *get_focused_container(swayc_t *parent) { void add_view(wlc_handle view_handle) { const uint32_t type = wlc_view_get_type(view_handle); - if (type & WLC_BIT_UNMANAGED) { - sway_log(L_DEBUG, "Leaving view %d alone (unmanaged)", view_handle); + const char *title = wlc_view_get_title(view_handle); + if ((type & WLC_BIT_UNMANAGED) || (type & WLC_BIT_POPUP) || (type & WLC_BIT_MODAL) || (type & WLC_BIT_SPLASH)) { + sway_log(L_DEBUG, "Leaving view %d:%s alone (unmanaged)", view_handle, title); return; } swayc_t *parent = get_focused_container(&root_container); - sway_log(L_DEBUG, "Adding new view %d under container %p %d", view_handle, parent, parent->type); + sway_log(L_DEBUG, "Adding new view %d:%s under container %p %d", view_handle, title, parent, parent->type); while (parent->type == C_VIEW) { parent = parent->parent; @@ -165,6 +169,8 @@ void add_view(wlc_handle view_handle) { view->handle = view_handle; view->parent = parent; view->type = C_VIEW; + view->name = malloc(strlen(title) + 1); + strcpy(view->name, title); add_child(parent, view); unfocus_all(&root_container); |