@@ -1635,10 +1635,10 @@ FocusScope {
1638− Image {
1638+ MouseArea {
1639− id: closeImage
1639+ id: closeMouseArea
1640+ objectName: "closeMouseArea"
1640 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1641 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1641− source: "graphics/window-close.svg"
1642 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1642 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1643 visible: !appDelegate.isDash && dragArea.distance == 0
1643 visible: !appDelegate.isDash && dragArea.distance == 0
1644 && index == spreadItem.highlightedIndex
1644 && index == spreadItem.highlightedIndex
@@ -1646,20 +1646,20 @@ FocusScope {
1646 && mousePos.y > -units.gu(4)
1646 && mousePos.y > -units.gu(4)
1647 && mousePos.x > -units.gu(4)
1647 && mousePos.x > -units.gu(4)
1648 && mousePos.x < (decoratedWindow.width * 2 / 3)
1648 && mousePos.x < (decoratedWindow.width * 2 / 3)
1649− height: units.gu(2)
1649+ height: units.gu(6)
1650 width: height
1650 width: height
1651− sourceSize.width: width
1651+
1652− sourceSize.height: height
1656− objectName: "closeMouseArea"
1657− anchors.fill: closeImage
1658− anchors.margins: -units.gu(2)
1659− onClicked: {
1652+ onClicked: {
1660− priv.closingIndex = index;
1653+ priv.closingIndex = index;
1661− appDelegate.close();
1654+ appDelegate.close();
1658+ source: "graphics/window-close.svg"
1659+ anchors.fill: closeMouseArea
1660+ anchors.margins: units.gu(2)
1661+ sourceSize.width: width
1662+ sourceSize.height: height
@@ -1718,13 +1718,13 @@ FocusScope {
1720 // Find the hovered item and mark it active
1720 // Find the hovered item and mark it active
1721− var mapped = mapToItem(appContainer, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1721+ for (var i = appRepeater.count - 1; i >= 0; i--) {
1722− var itemUnder = appContainer.childAt(mapped.x, mapped.y)
1722+ var appDelegate = appRepeater.itemAt(i);
1724− mapped = mapToItem(itemUnder, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1723+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1725− var delegateChild = itemUnder.childAt(mapped.x, mapped.y)
1724+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
1726− if (delegateChild && (delegateChild.objectName === "dragArea" || delegateChild.objectName === "windowInfoItem")) {
1725+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
1727− spreadItem.highlightedIndex = appRepeater.indexOf(itemUnder)
1726+ spreadItem.highlightedIndex = i;