aboutsummaryrefslogtreecommitdiff
path: root/sway/handlers.c
diff options
context:
space:
mode:
authorZandr Martin <zandrmartin@gmail.com>2016-07-02 08:14:40 -0500
committerZandr Martin <zandrmartin@gmail.com>2016-07-02 08:14:40 -0500
commit034410819d4c8ea28105c5a5eef0563635a36a9d (patch)
treef24f60afd5ee641bddc78e6b16a8035e3abf7469 /sway/handlers.c
parentcbbeeb2cc3037d7538c7124e6ac0fe9e239731bb (diff)
parent7144fb9fc3b3d3b45d23deaab6a10caf3216cca4 (diff)
Merge remote-tracking branch 'upstream/master' into set-size-command
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index b38f05a6..53dbeb87 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -198,11 +198,12 @@ static bool handle_view_created(wlc_handle handle) {
if (pid) {
// using newview as a temp storage location here,
// rather than adding yet another workspace var
- if ((newview = workspace_for_pid(pid))) {
+ newview = workspace_for_pid(pid);
+ if (newview && newview != current_ws) {
focused = newview;
- newview = NULL;
return_to_workspace = true;
}
+ newview = NULL;
}
}
@@ -234,8 +235,12 @@ static bool handle_view_created(wlc_handle handle) {
switch (wlc_view_get_type(handle)) {
// regular view created regularly
case 0:
- newview = new_view(focused, handle);
- wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true);
+ if (parent) {
+ newview = new_floating_view(handle);
+ } else {
+ newview = new_view(focused, handle);
+ wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true);
+ }
break;
// Dmenu keeps viewfocus, but others with this flag don't, for now simulate