@@ -1,5 +1,5 @@
2− * Copyright (C) 2015-2016 Canonical, Ltd.
2+ * Copyright (C) 2015-2017 Canonical, Ltd.
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);
765+ Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1670361
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).
770+ function test_clickNearTopEdgeGoesToWindow() {
771+ compare(topLevelSurfaceList.count, 1); // assume unity8-dash is already there
773+ var appDelegate = findChild(stage, "appDelegate_" + topLevelSurfaceList.idAt(0));
774+ verify(appDelegate);
776+ var surfaceItem = findChild(appDelegate, "surfaceItem");
777+ verify(surfaceItem);
779+ compare(surfaceItem.mousePressCount, 0);
780+ compare(surfaceItem.mouseReleaseCount, 0);
782+ mouseClick(appDelegate, 1, 1); // near top left
784+ compare(surfaceItem.mousePressCount, 1);
785+ compare(surfaceItem.mouseReleaseCount, 1);
787+ mouseClick(appDelegate, appDelegate.width / 2, 1); // near top
789+ compare(surfaceItem.mousePressCount, 2);
790+ compare(surfaceItem.mouseReleaseCount, 2);
792+ mouseClick(appDelegate, appDelegate.width - 1, 1); // near top right
794+ compare(surfaceItem.mousePressCount, 3);
795+ compare(surfaceItem.mouseReleaseCount, 3);