fix: resolve Overwatch and game window detection on taskbar by relaxing KWin skipTaskbar filtering

This commit is contained in:
Sho 2026-08-02 14:28:39 +09:00
parent 07ed2467e4
commit 9956338dcf
2 changed files with 56 additions and 9 deletions

View File

@ -6,8 +6,12 @@ function updateWindows() {
var wins = workspace.windowList(); var wins = workspace.windowList();
var activeWin = workspace.activeWindow; var activeWin = workspace.activeWindow;
if (activeWin && !activeWin.skipTaskbar) { if (activeWin) {
actApp = (activeWin.resourceClass || activeWin.desktopFileName || "").toLowerCase(); var actCls = (activeWin.resourceClass || activeWin.desktopFileName || activeWin.resourceName || "").toLowerCase();
if (!actCls && activeWin.caption) actCls = activeWin.caption.toLowerCase();
if (actCls && actCls !== "quickshell" && actCls !== "plasmashell") {
actApp = actCls;
}
if (activeWin.fullScreen) { if (activeWin.fullScreen) {
isFullscreen = true; isFullscreen = true;
} }
@ -18,16 +22,20 @@ function updateWindows() {
if (w.fullScreen && (w.active || w === activeWin)) { if (w.fullScreen && (w.active || w === activeWin)) {
isFullscreen = true; isFullscreen = true;
} }
if ((w.normalWindow || w.fullScreen || w.managed) && !w.skipTaskbar) { if (w.normalWindow || w.fullScreen || w.managed) {
var cls = (w.resourceClass || w.desktopFileName || "").toLowerCase(); var cls = (w.desktopFileName || w.resourceClass || w.resourceName || "").toLowerCase();
if (!cls && w.caption) cls = w.caption.toLowerCase(); if (!cls && w.caption) cls = w.caption.toLowerCase();
if (cls && cls !== "quickshell" && cls !== "plasmashell" && cls.indexOf("status_icon") === -1 && cls.indexOf("tray") === -1 && cls.indexOf("desktop") === -1) { if (cls) {
var isSystemShell = (cls === "quickshell" || cls === "plasmashell" || cls === "krunner" ||
cls.indexOf("status_icon") !== -1 || cls.indexOf("tray") !== -1 || cls.indexOf("desktop") !== -1);
if (!isSystemShell) {
if (openApps.indexOf(cls) === -1) { if (openApps.indexOf(cls) === -1) {
openApps.push(cls); openApps.push(cls);
} }
} }
} }
} }
}
callDBus("io.quickshell.ActiveApp", "/ActiveApp", "io.quickshell.ActiveApp", "updateState", actApp, JSON.stringify(openApps), isFullscreen ? "true" : "false"); callDBus("io.quickshell.ActiveApp", "/ActiveApp", "io.quickshell.ActiveApp", "updateState", actApp, JSON.stringify(openApps), isFullscreen ? "true" : "false");
} }

View File

@ -138,6 +138,44 @@ def resolve_game_info(app_lower):
"icon": game_icon "icon": game_icon
} }
# Handle Overwatch & Battle.net games
if 'overwatch' in app_lower:
ow_icon = "overwatch"
for d in _search_dirs:
if not os.path.exists(d): continue
for ext in ['.svg', '.png']:
t = os.path.join(d, "overwatch" + ext)
if os.path.exists(t):
ow_icon = t
break
return {
"appId": app_lower,
"name": "Overwatch",
"icon": ow_icon
}
if 'battle.net' in app_lower or 'battlenet' in app_lower:
return {
"appId": app_lower,
"name": "Battle.net",
"icon": "battle.net"
}
# Handle Heroic & Bottles games
if 'heroic' in app_lower:
return {
"appId": app_lower,
"name": "Heroic Games Launcher",
"icon": "com.heroicgameslauncher.hgl"
}
if 'bottles' in app_lower:
return {
"appId": app_lower,
"name": "Bottles Game",
"icon": "com.usebottles.bottles"
}
# Handle Lutris games # Handle Lutris games
if 'lutris' in app_lower: if 'lutris' in app_lower:
lutris_desktops = glob.glob(os.path.expanduser('~/.local/share/applications/lutris-*.desktop')) lutris_desktops = glob.glob(os.path.expanduser('~/.local/share/applications/lutris-*.desktop'))
@ -151,10 +189,11 @@ def resolve_game_info(app_lower):
} }
# Handle Wine / Proton / Gamescope generic titles # Handle Wine / Proton / Gamescope generic titles
if app_lower in ['wine', 'wine64', 'proton', 'gamescope']: if app_lower in ['wine', 'wine64', 'proton', 'gamescope'] or 'wine' in app_lower or 'proton' in app_lower or app_lower.endswith('.exe'):
clean_name = os.path.basename(app_lower).replace('.exe', '').replace('_', ' ').title()
return { return {
"appId": app_lower, "appId": app_lower,
"name": app_lower.capitalize() + " Game", "name": clean_name if clean_name else "Game",
"icon": "com.valvesoftware.Steam" "icon": "com.valvesoftware.Steam"
} }