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