aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/move.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-04-30 17:08:25 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-04-30 15:22:02 -0600
commit13cbb3b7fca490cb7356de964d73ac3506c5f407 (patch)
tree59df06054c54f80fe95f307eedea7ec49662cc3a /sway/commands/move.c
parentFix a silly mistake (diff)
downloadsway-13cbb3b7fca490cb7356de964d73ac3506c5f407.tar.gz
sway-13cbb3b7fca490cb7356de964d73ac3506c5f407.tar.zst
sway-13cbb3b7fca490cb7356de964d73ac3506c5f407.zip
cmd_move: add support for output current
This adds support for the following commands for i3 compatibility: - `move [window|container] [to] output current` - `move workspace to [output] current` - `move workspace [to] output current` The above commands are only useful when used with criteria.
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r--sway/commands/move.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index 4dec889c..9c6e69ec 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -28,6 +28,15 @@ static const char expected_syntax[] =
28 28
29static struct sway_output *output_in_direction(const char *direction_string, 29static struct sway_output *output_in_direction(const char *direction_string,
30 struct sway_output *reference, int ref_lx, int ref_ly) { 30 struct sway_output *reference, int ref_lx, int ref_ly) {
31 if (strcasecmp(direction_string, "current") == 0) {
32 struct sway_workspace *active_ws =
33 seat_get_focused_workspace(config->handler_context.seat);
34 if (!active_ws) {
35 return NULL;
36 }
37 return active_ws->output;
38 }
39
31 struct { 40 struct {
32 char *name; 41 char *name;
33 enum wlr_direction direction; 42 enum wlr_direction direction;