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.
This commit is contained in:
Brian Ashworth 2019-04-30 17:08:25 -04:00 committed by Drew DeVault
parent 3b3e0560be
commit 13cbb3b7fc
2 changed files with 12 additions and 3 deletions

View file

@ -28,6 +28,15 @@ static const char expected_syntax[] =
static struct sway_output *output_in_direction(const char *direction_string,
struct sway_output *reference, int ref_lx, int ref_ly) {
if (strcasecmp(direction_string, "current") == 0) {
struct sway_workspace *active_ws =
seat_get_focused_workspace(config->handler_context.seat);
if (!active_ws) {
return NULL;
}
return active_ws->output;
}
struct {
char *name;
enum wlr_direction direction;