on xenial help sign in
Really disable the window decoration when in staged mode
bb09f86Daniel d'Andrada
qml/Stage/DecoratedWindow.qml+3−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2014-2016 Canonical, Ltd.
2+ * Copyright (C) 2014-2017 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -207,6 +207,8 @@ FocusScope {
207
207
208 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
208 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
209 Behavior on opacity { UbuntuNumberAnimation { } }
209 Behavior on opacity { UbuntuNumberAnimation { } }
210+ // don't eat clicks when decoration is not wanted (nor visible to the user)
211+ visible: root.hasDecoration || opacity > 0
210
212
211 onPressed: root.decorationPressed();
213 onPressed: root.decorationPressed();
212 onPressedChanged: moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY)
214 onPressedChanged: moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY)
tests/qmltests/Stage/tst_TabletStage.qml+33−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2015-2016 Canonical, Ltd.
2+ * Copyright (C) 2015-2017 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -761,6 +761,38 @@ Rectangle {
761 tryCompare(appDelegate, "stage", ApplicationInfoInterface.SideStage);
761 tryCompare(appDelegate, "stage", ApplicationInfoInterface.SideStage);
762 }
762 }
763
763
764+ /*
765+ Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1670361
766+
767+ Clicks near the top window edge (but still inside the window boundaries) should go to
768+ the window (and not get eaten by some translucent decoration like in that bug).
769+ */
770+ function test_clickNearTopEdgeGoesToWindow() {
771+ compare(topLevelSurfaceList.count, 1); // assume unity8-dash is already there
772+
773+ var appDelegate = findChild(stage, "appDelegate_" + topLevelSurfaceList.idAt(0));
774+ verify(appDelegate);
775+
776+ var surfaceItem = findChild(appDelegate, "surfaceItem");
777+ verify(surfaceItem);
778+
779+ compare(surfaceItem.mousePressCount, 0);
780+ compare(surfaceItem.mouseReleaseCount, 0);
764
781
782+ mouseClick(appDelegate, 1, 1); // near top left
783+
784+ compare(surfaceItem.mousePressCount, 1);
785+ compare(surfaceItem.mouseReleaseCount, 1);
786+
787+ mouseClick(appDelegate, appDelegate.width / 2, 1); // near top
788+
789+ compare(surfaceItem.mousePressCount, 2);
790+ compare(surfaceItem.mouseReleaseCount, 2);
791+
792+ mouseClick(appDelegate, appDelegate.width - 1, 1); // near top right
793+
794+ compare(surfaceItem.mousePressCount, 3);
795+ compare(surfaceItem.mouseReleaseCount, 3);
796+ }
765 }
797 }
766}
798}