on xenial help sign in
don't displace windows if the OSK is on another screen (LP: #1598917)
42ff049Michael Zanetti
qml/Shell.qml+5
@@ -387,6 +387,11 @@ StyledItem {
387 property: "topLevelSurfaceList"
387 property: "topLevelSurfaceList"
388 value: topLevelSurfaceList
388 value: topLevelSurfaceList
389 }
389 }
390+ Binding {
391+ target: applicationsDisplayLoader.item
392+ property: "oskEnabled"
393+ value: shell.oskEnabled
394+ }
390 }
395 }
391 }
396 }
392
397
qml/Stages/AbstractStage.qml+1
@@ -43,6 +43,7 @@ FocusScope {
43 // A Stage should paint a wallpaper etc over its full size but not use the margins for window placement
43 // A Stage should paint a wallpaper etc over its full size but not use the margins for window placement
44 property int leftMargin: 0
44 property int leftMargin: 0
45 property alias paintBackground: background.visible
45 property alias paintBackground: background.visible
46+ property bool oskEnabled: false
46
47
47 // To be read from outside
48 // To be read from outside
48 property var mainApp: null
49 property var mainApp: null
qml/Stages/DesktopStage.qml+1−1
@@ -274,7 +274,7 @@ AbstractStage {
274 value: appDelegate.requestedY -
274 value: appDelegate.requestedY -
275 Math.min(appDelegate.requestedY - PanelState.panelHeight,
275 Math.min(appDelegate.requestedY - PanelState.panelHeight,
276 Math.max(0, UbuntuKeyboardInfo.height - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
276 Math.max(0, UbuntuKeyboardInfo.height - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
277− when: appDelegate.focus && appDelegate.state == "normal"
277+ when: root.oskEnabled && appDelegate.focus && appDelegate.state == "normal"
278 && SurfaceManager.inputMethodSurface
278 && SurfaceManager.inputMethodSurface
279 && SurfaceManager.inputMethodSurface.state != Mir.HiddenState
279 && SurfaceManager.inputMethodSurface.state != Mir.HiddenState
280 && SurfaceManager.inputMethodSurface.state != Mir.MinimizedState
280 && SurfaceManager.inputMethodSurface.state != Mir.MinimizedState
tests/qmltests/Stages/tst_DesktopStage.qml+5−3
@@ -519,13 +519,15 @@ Item {
519
519
520 function test_oskDisplacesWindow_data() {
520 function test_oskDisplacesWindow_data() {
521 return [
521 return [
522− {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5)},
522+ {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5), oskEnabled: true},
523− {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: PanelState.panelHeight},
523+ {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: PanelState.panelHeight, oskEnabled: true},
524− {tag: "displace a bit", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: (root.height / 2) - units.gu(40)},
524+ {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: PanelState.panelHeight, oskEnabled: true},
525+ {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: units.gu(10), oskEnabled: false},
525 ]
526 ]
526 }
527 }
527
528
528 function test_oskDisplacesWindow(data) {
529 function test_oskDisplacesWindow(data) {
530+ desktopStageLoader.item.oskEnabled = data.oskEnabled
529 var dashAppDelegate = startApplication("unity8-dash");
531 var dashAppDelegate = startApplication("unity8-dash");
530 var oldOSKState = SurfaceManager.inputMethodSurface.state;
532 var oldOSKState = SurfaceManager.inputMethodSurface.state;
531 SurfaceManager.inputMethodSurface.state = Mir.RestoredState;
533 SurfaceManager.inputMethodSurface.state = Mir.RestoredState;