on xenial help sign in
Really disable the window decoration when in staged mode

Instead of having it only fully translucent (but still catching input). So that it doesn't eat mouse clicks and taps near the window's top edge

commitbb09f86996f2af144f4332e42dc57e0ec0c31b67 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateMon 6 Mar 2017, 11:49 (10 years ago) parent78e61ae
2 files changed+36−2
qml/Stage/DecoratedWindow.qml+3−1 tests/qmltests/Stage/tst_TabletStage.qml+33−1
qml/Stage/DecoratedWindow.qml+3−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014-2016 Canonical, Ltd.
2+ * Copyright (C) 2014-2017 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -207,6 +207,8 @@ FocusScope {
207207
208208 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
209209 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
210212
211213 onPressed: root.decorationPressed();
212214 onPressedChanged: moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY)
tests/qmltests/Stage/tst_TabletStage.qml+33−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2015-2016 Canonical, Ltd.
2+ * Copyright (C) 2015-2017 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -761,6 +761,38 @@ Rectangle {
761761 tryCompare(appDelegate, "stage", ApplicationInfoInterface.SideStage);
762762 }
763763
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);
764781
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+ }
765797 }
766798}