@@ -182,6 +182,12 @@ IndicatorTest {
182182 signalName: "pressedChanged"
183183 }
184184
185+ SignalSpy {
186+ id: windowControlButtonsSpy
187+ target: PanelState
188+ signalName: "closeClicked"
189+ }
190+
185191 function init() {
186192 panel.fullscreenMode = false;
187193 callManager.foregroundCall = null;
@@ -197,6 +203,8 @@ IndicatorTest {
197203
198204 backgroundPressedSpy.clear();
199205 compare(backgroundPressedSpy.valid, true);
206+ windowControlButtonsSpy.clear();
207+ compare(windowControlButtonsSpy.valid, true);
200208 }
201209
202210 function get_indicator_item(index) {
@@ -494,5 +502,16 @@ IndicatorTest {
494502 compare(panel.indicators.shown, false);
495503 tryCompare(panel.indicators, "fullyClosed", true);
496504 }
505+
506+ // https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1611959
507+ function test_windowControlButtonsFittsLaw() {
508+ var buttonsVisible = PanelState.buttonsVisible;
509+ PanelState.buttonsVisible = true;
510+ // click in very topleft corner and verify the close button got clicked too
511+ mouseMove(panel, 0, 0);
512+ mouseClick(panel, 0, 0, undefined /*button*/, undefined /*modifiers*/, 100 /*short delay*/);
513+ compare(windowControlButtonsSpy.count, 1);
514+ PanelState.buttonsVisible = buttonsVisible;
515+ }
497516 }
498517}