diff options
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 13 |
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) { | |||
198 | if (pid) { | 198 | if (pid) { |
199 | // using newview as a temp storage location here, | 199 | // using newview as a temp storage location here, |
200 | // rather than adding yet another workspace var | 200 | // rather than adding yet another workspace var |
201 | if ((newview = workspace_for_pid(pid))) { | 201 | newview = workspace_for_pid(pid); |
202 | if (newview && newview != current_ws) { | ||
202 | focused = newview; | 203 | focused = newview; |
203 | newview = NULL; | ||
204 | return_to_workspace = true; | 204 | return_to_workspace = true; |
205 | } | 205 | } |
206 | newview = NULL; | ||
206 | } | 207 | } |
207 | } | 208 | } |
208 | 209 | ||
@@ -234,8 +235,12 @@ static bool handle_view_created(wlc_handle handle) { | |||
234 | switch (wlc_view_get_type(handle)) { | 235 | switch (wlc_view_get_type(handle)) { |
235 | // regular view created regularly | 236 | // regular view created regularly |
236 | case 0: | 237 | case 0: |
237 | newview = new_view(focused, handle); | 238 | if (parent) { |
238 | wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true); | 239 | newview = new_floating_view(handle); |
240 | } else { | ||
241 | newview = new_view(focused, handle); | ||
242 | wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true); | ||
243 | } | ||
239 | break; | 244 | break; |
240 | 245 | ||
241 | // Dmenu keeps viewfocus, but others with this flag don't, for now simulate | 246 | // Dmenu keeps viewfocus, but others with this flag don't, for now simulate |