From 396d88c2287a0d9145b6eb34e1e2a927d7c7d343 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Thu, 23 Oct 2014 22:58:21 +0200 Subject: [PATCH] Anchor application windows to the layer --- compositor/contents/WindowManagement.js | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/compositor/contents/WindowManagement.js b/compositor/contents/WindowManagement.js index 67b29dab..f30031a6 100644 --- a/compositor/contents/WindowManagement.js +++ b/compositor/contents/WindowManagement.js @@ -107,36 +107,21 @@ function mapApplicationSurface(surface) { return; } - // Window position: y is hard coded to the top bar height - var pos = Qt.point(0, compositorRoot.topBarHeight); - // Request a view for this output although with phones will // likely have just one output var child = compositor.viewForOutput(surface, _greenisland_output); // Create and setup window container - var window = component.createObject(compositorRoot, {"child": child}); + var window = component.createObject(compositorRoot.layers.windows, {"child": child}); window.child.parent = window; window.child.touchEventsEnabled = true; + //surface.requestSize(window.parent.width, window.parent.height); + window.anchors.top = window.parent.top; + window.anchors.left = window.parent.left; window.width = surface.size.width; window.height = surface.size.height; - - // Move window - window.x = pos.x; - window.y = pos.y; - - // Reparent and give focus - window.parent = compositorRoot.layers.windows; window.child.takeFocus(); - // Set size to parent (windows layer) - window.child.resizeSurfaceToItem = true; - window.width = window.parent.width; - window.height = window.parent.height; - - // Log coordinates for debugging purpose - console.debug("\tposition:", window.x + "," + window.y); - // Run map animation if (typeof(window.runMapAnimation) != "undefined") window.runMapAnimation();