aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c9
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 @@
#include <ctype.h>
#include "stringop.h"
#include "layout.h"
-#include "movement.h"
+#include "focus.h"
#include "log.h"
#include "workspace.h"
#include "commands.h"
@@ -215,11 +215,12 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) {
view->is_floating = false;
active_workspace->focused = NULL;
// Get the properly focused container, and add in the view there
- swayc_t *focused = focus_pointer();
+ swayc_t *focused = container_under_pointer();
// If focused is null, it's because the currently focused container is a workspace
if (focused == NULL) {
focused = active_workspace;
}
+ set_focused_container(focused);
sway_log(L_DEBUG, "Non-floating focused container is %p", focused);
@@ -232,7 +233,7 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) {
add_sibling(focused, view);
}
// Refocus on the view once its been put back into the layout
- focus_view(view);
+ set_focused_container(view);
arrange_windows(active_workspace, -1, -1);
return true;
}
@@ -345,7 +346,7 @@ static bool _do_split(struct sway_config *config, int argc, char **argv, int lay
else {
sway_log(L_DEBUG, "Adding new container around current focused container");
swayc_t *parent = new_container(focused, layout);
- focus_view(focused);
+ set_focused_container(focused);
arrange_windows(parent, -1, -1);
}