on xenial help sign in
use inputMethodVisibleRect as suggested in review
commit5ca7d986dba33934d4ca1d7217db5576ab959c6f authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 22 Sep 2016, 16:17 (10 years ago) parent4204e74
3 files changed+4−8
qml/Shell.qml+1 qml/Stage/ApplicationWindow.qml−1 qml/Stage/Stage.qml+3−7
qml/Shell.qml+1
@@ -283,6 +283,7 @@ StyledItem {
283283
284284 applicationManager: ApplicationManager
285285 topLevelSurfaceList: topLevelSurfaceList
286+ inputMethodRect: inputMethod.visibleRect
286287
287288 property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
288289 ? "phone"
qml/Stage/ApplicationWindow.qml−1
@@ -33,7 +33,6 @@ FocusScope {
3333 property QtObject surface
3434 property QtObject application
3535 property int surfaceOrientationAngle
36− property alias resizeSurface: surfaceContainer.resizeSurface
3736 property int requestedWidth: -1
3837 property int requestedHeight: -1
3938 property real splashRotation: 0
qml/Stage/Stage.qml+3−7
@@ -47,6 +47,7 @@ FocusScope {
4747 property bool suspended
4848 property int leftMargin: 0
4949 property bool oskEnabled: false
50+ property rect inputMethodRect
5051
5152 // Configuration
5253 property string mode: "staged"
@@ -306,9 +307,7 @@ FocusScope {
306307 return -1;
307308 }
308309
309− readonly property real virtualKeyboardHeight: SurfaceManager.inputMethodSurface
310− ? SurfaceManager.inputMethodSurface.inputBounds.height
311− : 0
310+ readonly property real virtualKeyboardHeight: root.inputMethodRect.height
312311 }
313312
314313 Component.onCompleted: priv.updateMainAndSideStageIndexes();
@@ -641,9 +640,7 @@ FocusScope {
641640 Math.min(appDelegate.requestedY - PanelState.panelHeight,
642641 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
643642 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
644− && SurfaceManager.inputMethodSurface
645− && SurfaceManager.inputMethodSurface.state != Mir.HiddenState
646− && SurfaceManager.inputMethodSurface.state != Mir.MinimizedState
643+ && root.inputMethodRect.height > 0
647644
648645 }
649646
@@ -1837,7 +1834,6 @@ FocusScope {
18371834
18381835 consumesInput: false
18391836 interactive: false
1840−// resizeSurface: false
18411837 focus: false
18421838 requestedWidth: appDelegate.requestedWidth
18431839 requestedHeight: appDelegate.requestedHeight