@@ -1650,10 +1650,10 @@ FocusScope {
1653− Image {
1653+ MouseArea {
1654− id: closeImage
1654+ id: closeMouseArea
1655+ objectName: "closeMouseArea"
1655 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1656 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1656− source: "graphics/window-close.svg"
1657 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1657 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1658 visible: !appDelegate.isDash && dragArea.distance == 0
1658 visible: !appDelegate.isDash && dragArea.distance == 0
1659 && index == spreadItem.highlightedIndex
1659 && index == spreadItem.highlightedIndex
@@ -1661,20 +1661,20 @@ FocusScope {
1661 && mousePos.y > -units.gu(4)
1661 && mousePos.y > -units.gu(4)
1662 && mousePos.x > -units.gu(4)
1662 && mousePos.x > -units.gu(4)
1663 && mousePos.x < (decoratedWindow.width * 2 / 3)
1663 && mousePos.x < (decoratedWindow.width * 2 / 3)
1664− height: units.gu(2)
1664+ height: units.gu(6)
1665 width: height
1665 width: height
1666− sourceSize.width: width
1666+
1667− sourceSize.height: height
1671− objectName: "closeMouseArea"
1672− anchors.fill: closeImage
1673− anchors.margins: -units.gu(2)
1674− onClicked: {
1667+ onClicked: {
1675− priv.closingIndex = index;
1668+ priv.closingIndex = index;
1676− appDelegate.close();
1669+ appDelegate.close();
1673+ source: "graphics/window-close.svg"
1674+ anchors.fill: closeMouseArea
1675+ anchors.margins: units.gu(2)
1676+ sourceSize.width: width
1677+ sourceSize.height: height
@@ -1733,13 +1733,13 @@ FocusScope {
1735 // Find the hovered item and mark it active
1735 // Find the hovered item and mark it active
1736− var mapped = mapToItem(appContainer, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1736+ for (var i = appRepeater.count - 1; i >= 0; i--) {
1737− var itemUnder = appContainer.childAt(mapped.x, mapped.y)
1737+ var appDelegate = appRepeater.itemAt(i);
1739− mapped = mapToItem(itemUnder, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1738+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1740− var delegateChild = itemUnder.childAt(mapped.x, mapped.y)
1739+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
1741− if (delegateChild && (delegateChild.objectName === "dragArea" || delegateChild.objectName === "windowInfoItem")) {
1740+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
1742− spreadItem.highlightedIndex = appRepeater.indexOf(itemUnder)
1741+ spreadItem.highlightedIndex = i;