diff options
author | D.B <thejan.2009@gmail.com> | 2016-10-08 12:37:28 +0200 |
---|---|---|
committer | D.B <thejan.2009@gmail.com> | 2016-10-08 12:37:28 +0200 |
commit | 8264fedce60743f93efc988ef282fa2a160faf5a (patch) | |
tree | 6042170fb3e5267e032cb52b7d8087854cc5f111 | |
parent | Merge pull request #938 from alkino/fix_sibling (diff) | |
download | sway-8264fedce60743f93efc988ef282fa2a160faf5a.tar.gz sway-8264fedce60743f93efc988ef282fa2a160faf5a.tar.zst sway-8264fedce60743f93efc988ef282fa2a160faf5a.zip |
fix for_window [] move scratchpad
- move wlc_view_set_mask before applying window criteria
- check parent_container because container in scratchpad doesn't have a
parent
-rw-r--r-- | sway/handlers.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index f37473aa..2235bc8b 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -376,6 +376,7 @@ static bool handle_view_created(wlc_handle handle) { | |||
376 | if (newview) { | 376 | if (newview) { |
377 | ipc_event_window(newview, "new"); | 377 | ipc_event_window(newview, "new"); |
378 | set_focused_container(newview); | 378 | set_focused_container(newview); |
379 | wlc_view_set_mask(handle, VISIBLE); | ||
379 | swayc_t *output = swayc_parent_by_type(newview, C_OUTPUT); | 380 | swayc_t *output = swayc_parent_by_type(newview, C_OUTPUT); |
380 | arrange_windows(output, -1, -1); | 381 | arrange_windows(output, -1, -1); |
381 | // check if it matches for_window in config and execute if so | 382 | // check if it matches for_window in config and execute if so |
@@ -401,8 +402,9 @@ static bool handle_view_created(wlc_handle handle) { | |||
401 | // if parent container is a workspace, newview its only child and | 402 | // if parent container is a workspace, newview its only child and |
402 | // layout is tabbed/stacked, add a container around newview | 403 | // layout is tabbed/stacked, add a container around newview |
403 | swayc_t *parent_container = newview->parent; | 404 | swayc_t *parent_container = newview->parent; |
404 | if (parent_container->type == C_WORKSPACE && parent_container->children->length == 1 && | 405 | if (parent_container && parent_container->type == C_WORKSPACE && |
405 | (parent_container->layout == L_TABBED || parent_container->layout == L_STACKED)) { | 406 | parent_container->children && parent_container->children->length == 1 && |
407 | (parent_container->layout == L_TABBED || parent_container->layout == L_STACKED)) { | ||
406 | swayc_t *container = new_container(newview, parent_container->layout); | 408 | swayc_t *container = new_container(newview, parent_container->layout); |
407 | set_focused_container(newview); | 409 | set_focused_container(newview); |
408 | arrange_windows(container, -1, -1); | 410 | arrange_windows(container, -1, -1); |
@@ -413,8 +415,8 @@ static bool handle_view_created(wlc_handle handle) { | |||
413 | *h = handle; | 415 | *h = handle; |
414 | sway_log(L_DEBUG, "Adding unmanaged window %p to %p", h, output->unmanaged); | 416 | sway_log(L_DEBUG, "Adding unmanaged window %p to %p", h, output->unmanaged); |
415 | list_add(output->unmanaged, h); | 417 | list_add(output->unmanaged, h); |
418 | wlc_view_set_mask(handle, VISIBLE); | ||
416 | } | 419 | } |
417 | wlc_view_set_mask(handle, VISIBLE); | ||
418 | 420 | ||
419 | if (return_to_workspace && current_ws != swayc_active_workspace()) { | 421 | if (return_to_workspace && current_ws != swayc_active_workspace()) { |
420 | // we were on one workspace, switched to another to add this view, | 422 | // we were on one workspace, switched to another to add this view, |