1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

Simplify mess

This commit is contained in:
bbedward
2025-08-23 13:22:30 -04:00
parent ad19107530
commit 1e2fdc5f24
2 changed files with 4 additions and 23 deletions

View File

@@ -25,18 +25,10 @@ Item {
property bool isHovered: mouseArea.containsMouse && !dragging
property bool showTooltip: mouseArea.containsMouse && !dragging
property bool isWindowFocused: {
if (!appData || appData.type !== "window") {
if (!appData || appData.type !== "window" || !appData.toplevelObject) {
return false
}
var toplevels = CompositorService.sortedToplevels
for (var i = 0; i < toplevels.length; i++) {
var toplevel = toplevels[i]
if (toplevel.appId === appData.appId) {
return toplevel.activated
}
}
return false
return appData.toplevelObject.activated
}
property string tooltipText: {
if (!appData)
@@ -216,14 +208,8 @@ Item {
desktopEntry.execute()
}
} else if (appData.type === "window") {
// Find the toplevel by matching appId from sorted list
var toplevels = CompositorService.sortedToplevels
for (var i = 0; i < toplevels.length; i++) {
var toplevel = toplevels[i]
if (toplevel.appId === appData.appId && toplevel.title === appData.windowTitle) {
toplevel.activate()
break
}
if (appData.toplevelObject) {
appData.toplevelObject.activate()
}
}
} else if (mouse.button === Qt.MiddleButton) {