diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sway/commands.c b/sway/commands.c index 444e6159..134593c7 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <ctype.h> | 8 | #include <ctype.h> |
9 | #include "stringop.h" | 9 | #include "stringop.h" |
10 | #include "layout.h" | 10 | #include "layout.h" |
11 | #include "movement.h" | 11 | #include "focus.h" |
12 | #include "log.h" | 12 | #include "log.h" |
13 | #include "workspace.h" | 13 | #include "workspace.h" |
14 | #include "commands.h" | 14 | #include "commands.h" |
@@ -215,11 +215,12 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) { | |||
215 | view->is_floating = false; | 215 | view->is_floating = false; |
216 | active_workspace->focused = NULL; | 216 | active_workspace->focused = NULL; |
217 | // Get the properly focused container, and add in the view there | 217 | // Get the properly focused container, and add in the view there |
218 | swayc_t *focused = focus_pointer(); | 218 | swayc_t *focused = container_under_pointer(); |
219 | // If focused is null, it's because the currently focused container is a workspace | 219 | // If focused is null, it's because the currently focused container is a workspace |
220 | if (focused == NULL) { | 220 | if (focused == NULL) { |
221 | focused = active_workspace; | 221 | focused = active_workspace; |
222 | } | 222 | } |
223 | set_focused_container(focused); | ||
223 | 224 | ||
224 | sway_log(L_DEBUG, "Non-floating focused container is %p", focused); | 225 | sway_log(L_DEBUG, "Non-floating focused container is %p", focused); |
225 | 226 | ||
@@ -232,7 +233,7 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) { | |||
232 | add_sibling(focused, view); | 233 | add_sibling(focused, view); |
233 | } | 234 | } |
234 | // Refocus on the view once its been put back into the layout | 235 | // Refocus on the view once its been put back into the layout |
235 | focus_view(view); | 236 | set_focused_container(view); |
236 | arrange_windows(active_workspace, -1, -1); | 237 | arrange_windows(active_workspace, -1, -1); |
237 | return true; | 238 | return true; |
238 | } | 239 | } |
@@ -345,7 +346,7 @@ static bool _do_split(struct sway_config *config, int argc, char **argv, int lay | |||
345 | else { | 346 | else { |
346 | sway_log(L_DEBUG, "Adding new container around current focused container"); | 347 | sway_log(L_DEBUG, "Adding new container around current focused container"); |
347 | swayc_t *parent = new_container(focused, layout); | 348 | swayc_t *parent = new_container(focused, layout); |
348 | focus_view(focused); | 349 | set_focused_container(focused); |
349 | arrange_windows(parent, -1, -1); | 350 | arrange_windows(parent, -1, -1); |
350 | } | 351 | } |
351 | 352 | ||