From e2219e840253bcfb33c5da8db3880a87d3c1b9cf Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 10 Dec 2014 21:51:48 +0100 Subject: [PATCH] hide keyboard in switch mode --- compositor/contents/ClientWindowWrapper.qml | 3 ++- compositor/contents/Compositor.qml | 12 ++++++++++++ compositor/contents/WindowManagement.js | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/compositor/contents/ClientWindowWrapper.qml b/compositor/contents/ClientWindowWrapper.qml index 8b239aaf..b18cbb52 100644 --- a/compositor/contents/ClientWindowWrapper.qml +++ b/compositor/contents/ClientWindowWrapper.qml @@ -56,7 +56,8 @@ WindowWrapper { active = true; } onClicked: { - compositorRoot.currentWindow = window + compositorRoot.currentWindow = window; + window.child.takeFocus(); } onReleased: { active = false; diff --git a/compositor/contents/Compositor.qml b/compositor/contents/Compositor.qml index 69150147..77339c57 100644 --- a/compositor/contents/Compositor.qml +++ b/compositor/contents/Compositor.qml @@ -31,6 +31,7 @@ Rectangle { readonly property real topBarHeight: units.iconSizes.small readonly property real bottomBarHeight: units.iconSizes.medium property var currentWindow: null + property var shellWindow: null; onCurrentWindowChanged: { if (!currentWindow) { @@ -136,6 +137,15 @@ Rectangle { id: keyboardLayer anchors.fill: parent z: 5 + onVisibleChanged: { + if (!visible) { + compositorRoot.shellWindow.child.takeFocus(); + } + + if (compositorRoot.currentWindow) { + compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height - (visible ? 500 : 0); + } + } } Rectangle { @@ -213,6 +223,8 @@ Rectangle { } onPositionChanged: { compositorRoot.state = "switcher"; + compositorRoot.showKeyboard = false; + var newScale = (1-Math.abs(mouse.y)/(compositorRoot.height/2)) if (newScale > 0.3) { windowsLayout.scale = newScale diff --git a/compositor/contents/WindowManagement.js b/compositor/contents/WindowManagement.js index cec90f61..106c20cd 100644 --- a/compositor/contents/WindowManagement.js +++ b/compositor/contents/WindowManagement.js @@ -214,6 +214,7 @@ function mapShellSurface(surface, child) { compositorRoot.showPanel = true; } else { compositorRoot.state = "homeScreen"; + compositorRoot.shellWindow = window; } if (surface.className != "maliit-server.desktop") { window.child.takeFocus(); @@ -289,7 +290,7 @@ function unmapShellSurface(surface) { } } -function unmapShellSurface(surface) { +function unmapKeyboardSurface(surface) { if (compositorRoot.currentWindow) { compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height; }