@@ -884,5 +884,30 @@ Item {
884884 tryCompare(menu, "x", data.expectedMenuCoordinates.x);
885885 tryCompare(menu, "y", data.expectedMenuCoordinates.y);
886886 }
887+
888+ function test_menuDoubleClickNoMaximizeWindowBehind() {
889+ var appDelegate1 = startApplication("dialer-app");
890+ var appDelegate2 = startApplication("gmail-webapp");
891+
892+ // Open menu
893+ var menuItem = findChild(appDelegate2, "menuBar-item3");
894+ menuItem.show();
895+ var menu = findChild(appDelegate2, "menuBar-item3-menu");
896+ menuItem = findChild(menu, "menuBar-item3-menu-item3-actionItem");
897+ tryCompare(menuItem, "visible", true);
898+
899+ // Place the other application window decoration under the menu
900+ var pos = menuItem.mapToItem(null, menuItem.width / 2, menuItem.height / 2);
901+ appDelegate1.windowedX = pos.x - appDelegate1.width / 2;
902+ appDelegate1.windowedY = pos.y - units.gu(1);
903+
904+ var previousWindowState = appDelegate1.windowState;
905+
906+ mouseMove(menuItem);
907+ mouseDoubleClickSequence(menuItem);
908+
909+ expectFail("", "Double clicking a menu should not change the window below");
910+ tryCompareFunction(function() { return appDelegate1.windowState != previousWindowState; }, true);
911+ }
887912 }
888913}