aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-31 21:21:26 -0400
committerDrew DeVault <sir@cmpwn.com>2018-04-02 11:12:18 -0400
commitb2d871cfe215a82266d01847f4787bbcf8c721c9 (patch)
tree87dbae47c65d56730c816d7e6e2123e5e851dec2 /sway/desktop
parent122b96abed9955f78e3f157167d34312f5bb551d (diff)
Partially implement move command
Works: - move [container|window] to workspace <name> - Note, this should be able to move C_CONTAINER but this is untested - move [workspace] to output [left|right|up|down|<name>] Not implemented yet: - move [left|right|up|down] - move scratchpad - move position
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/output.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 0d706c52..c4265818 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -229,9 +229,12 @@ static void render_output(struct sway_output *output, struct timespec *when,
struct sway_seat *seat = input_manager_current_seat(input_manager);
struct sway_container *focus =
sway_seat_get_focus_inactive(seat, output->swayc);
- struct sway_container *workspace = (focus->type == C_WORKSPACE ?
- focus :
- container_parent(focus, C_WORKSPACE));
+ if (!focus) {
+ // We've never been to this output before
+ focus = output->swayc->children->items[0];
+ }
+ struct sway_container *workspace = focus->type == C_WORKSPACE ?
+ focus : container_parent(focus, C_WORKSPACE);
struct render_data rdata = {
.output = output,