From bfdda1505ec319b9ee812efa7059d646f7bea9d0 Mon Sep 17 00:00:00 2001 From: Mykyta Holubakha Date: Tue, 21 Jun 2016 20:38:06 +0300 Subject: Check if found ws is focused in new view handler Fixes #714, by preventing change of focus from a window to the whole ws --- sway/handlers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sway/handlers.c') diff --git a/sway/handlers.c b/sway/handlers.c index b38f05a6..c5aee4aa 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; } } -- cgit v1.2.3 From 7144fb9fc3b3d3b45d23deaab6a10caf3216cca4 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 30 Jun 2016 08:30:03 -0400 Subject: Spawn windows as floating if they have a parent Fixes #604 --- sway/handlers.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sway/handlers.c') diff --git a/sway/handlers.c b/sway/handlers.c index c5aee4aa..53dbeb87 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -235,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 -- cgit v1.2.3