summaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2015-08-10 23:54:23 -0400
committerDrew DeVault <[email protected]>2015-08-10 23:54:23 -0400
commit96d7ff1e19c1e6af47f21764ed613c5ebe53a557 (patch)
tree75566e3fb44600e63c1dbbec3f216425a57e70a6 /sway/layout.c
parentdd115cece3490a2d1791880cd45fae4b274a123a (diff)
Slightly better multihead support
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 08d1952c..ccf29f34 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -44,10 +44,16 @@ void arrange_windows(swayc_t *container, int width, int height) {
sway_log(L_DEBUG, "Arranging output at %d", x);
child->x = x;
child->y = y;
- arrange_windows(child, child->width, child->height);
+ arrange_windows(child, -1, -1);
x += child->width;
}
return;
+ case C_OUTPUT:
+ container->width = width;
+ container->height = height;
+ x -= container->x;
+ y -= container->y;
+ break;
case C_VIEW:
{
struct wlc_geometry geometry = {
@@ -342,9 +348,8 @@ void add_output(wlc_handle output) {
add_child(container, workspace);
sway_log(L_DEBUG, "Added workspace %s for output %d", workspace->name, output);
- workspace_switch(workspace);
-
if (root_container.focused == NULL) {
+ workspace_switch(workspace);
unfocus_all(&root_container);
focus_view(workspace);
}