From 3d5241e736956d8ef24e44497ec6ef6d55b85cb1 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Thu, 23 Oct 2014 23:00:43 +0200 Subject: [PATCH] Anchors shell windows too --- compositor/contents/WindowManagement.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/compositor/contents/WindowManagement.js b/compositor/contents/WindowManagement.js index f30031a6..82c5134f 100644 --- a/compositor/contents/WindowManagement.js +++ b/compositor/contents/WindowManagement.js @@ -145,22 +145,15 @@ function mapShellSurface(surface, child) { } // Create and setup window container - var window = component.createObject(compositorRoot, {"child": child}); + // XXX: We only support desktop roles for now + var window = component.createObject(compositorRoot.layers.desktop, {"child": child}); window.child.parent = window; window.child.touchEventsEnabled = true; + window.anchors.top = window.parent.top; + window.anchors.left = window.parent.left; window.width = surface.size.width; window.height = surface.size.height; - - // Set initial position - // XXX: We only support desktop roles for now - window.x = window.y = 0; - - // Set appropriate parent - // XXX: We only support desktop roles for now - window.parent = compositorRoot.layers.desktop; - - // Log coordinates for debugging purpose - console.debug("\tposition:", window.x + "," + window.y); + window.child.takeFocus(); // Add surface to the model surfaceModel.append({"surface": surface, "window": window});