From 7a3c32949a41db9031310e6502ba2dc730b3d0e7 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 11 Dec 2014 10:38:20 +0100 Subject: [PATCH] don't resize the window on keyboard --- compositor/contents/Compositor.qml | 9 ++++--- compositor/contents/WindowManagement.js | 31 +++++-------------------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/compositor/contents/Compositor.qml b/compositor/contents/Compositor.qml index 77339c57..0f7c19fd 100644 --- a/compositor/contents/Compositor.qml +++ b/compositor/contents/Compositor.qml @@ -138,13 +138,9 @@ Rectangle { anchors.fill: parent z: 5 onVisibleChanged: { - if (!visible) { + if (!visible && compositorRoot.shellWindow) { compositorRoot.shellWindow.child.takeFocus(); } - - if (compositorRoot.currentWindow) { - compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height - (visible ? 500 : 0); - } } } @@ -328,6 +324,9 @@ Rectangle { } else { desktopLayer.z = 1; windowsLayerBackground.z = 2; + if (compositorRoot.currentWindow) { + compositorRoot.currentWindow.child.takeFocus(); + } } } } diff --git a/compositor/contents/WindowManagement.js b/compositor/contents/WindowManagement.js index 106c20cd..ba5d6c68 100644 --- a/compositor/contents/WindowManagement.js +++ b/compositor/contents/WindowManagement.js @@ -173,16 +173,12 @@ function mapShellSurface(surface, child) { if (entry.surface === surface) { // Switch to layer and take focus - if (surface.className == "plasmashell.desktop" || surface.className == "maliit-server.desktop") { + if (surface.className == "plasmashell.desktop") { compositorRoot.showPanel = true; } else { compositorRoot.state = "homeScreen"; } - if (surface.className == "maliit-server.desktop") { - compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height - 500; - } else { - entry.window.child.takeFocus(); - } + entry.window.child.takeFocus(); return; } @@ -198,27 +194,22 @@ function mapShellSurface(surface, child) { // Create and setup window container // XXX: We only support desktop roles for now var window = component.createObject(compositorRoot, {"child": child}); - window.parent = (surface.className == "plasmashell.desktop" || surface.className == "maliit-server.desktop") ? compositorRoot.layers.panel : compositorRoot.layers.desktop; + window.parent = (surface.className == "plasmashell.desktop") ? compositorRoot.layers.panel : compositorRoot.layers.desktop; window.child.parent = window; window.child.touchEventsEnabled = true; window.x = window.y = 0; window.width = surface.size.width; window.height = surface.size.height; - if (surface.className == "maliit-server.desktop") { - window.y = compositorRoot.layers.panel.height - window.height; - } // Switch to the desktop layer and take focus compositorRoot.showSplash = false; - if (surface.className == "plasmashell.desktop" || surface.className == "maliit-server.desktop") { + if (surface.className == "plasmashell.desktop") { compositorRoot.showPanel = true; } else { compositorRoot.state = "homeScreen"; compositorRoot.shellWindow = window; } - if (surface.className != "maliit-server.desktop") { - window.child.takeFocus(); - } + window.child.takeFocus(); // Add surface to the model surfaceModel.append({"surface": surface, "window": window}); @@ -231,9 +222,6 @@ function mapKeyboardSurface(surface) { var entry = surfaceModel.get(i); if (entry.surface === surface) { - if (compositorRoot.currentWindow) { - compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height - 500; - } compositorRoot.showKeyboard = true; return; @@ -260,10 +248,6 @@ function mapKeyboardSurface(surface) { window.height = surface.size.height; window.y = compositorRoot.layers.keyboard.height - window.height; - if (compositorRoot.currentWindow) { - compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height - 500; - } - // Add surface to the model surfaceModel.append({"surface": surface, "window": window}); compositorRoot.showKeyboard = true; @@ -281,11 +265,8 @@ function unmapApplicationSurface(surface) { } function unmapShellSurface(surface) { - if (surface.className == "maliit-server.desktop") { - compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height; - } // Hide panel layer if this is the sliding panel - if (surface.className == "plasmashell.desktop" || surface.className == "maliit-server.desktop") { + if (surface.className == "plasmashell.desktop") { compositorRoot.showPanel = false; } }