summaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2015-08-09 08:32:31 -0400
committerDrew DeVault <[email protected]>2015-08-09 08:35:33 -0400
commit086691016e7cbe9794b73c174eaefa77e2d56498 (patch)
tree6d64cafadaf4812bb0362f23e66e9a50fe50bb3d /sway/layout.c
parentf2b9fd6f39399a5f167723ab616f2b51290f08cd (diff)
Handle unmanaged windows appropriately
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 403ec13a..2a57ccce 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -121,6 +121,12 @@ 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);
+ 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);
@@ -142,6 +148,10 @@ void add_view(wlc_handle view_handle) {
}
void destroy_view(swayc_t *view) {
+ if (view == NULL) {
+ sway_log(L_DEBUG, "Warning: NULL passed into destroy_view");
+ return;
+ }
sway_log(L_DEBUG, "Destroying container %p", view);
swayc_t *parent = view->parent;
if (!parent) {