From 9956338dcfbcfd74e7d050877932d50e1a705eb0 Mon Sep 17 00:00:00 2001 From: Sho Date: Sun, 2 Aug 2026 14:28:39 +0900 Subject: [PATCH] fix: resolve Overwatch and game window detection on taskbar by relaxing KWin skipTaskbar filtering --- quickshell/services/js/kwin_state_listener.js | 22 +++++++--- .../services/python/active_window_service.py | 43 ++++++++++++++++++- 2 files changed, 56 insertions(+), 9 deletions(-) diff --git a/quickshell/services/js/kwin_state_listener.js b/quickshell/services/js/kwin_state_listener.js index 227f5b5..303f460 100644 --- a/quickshell/services/js/kwin_state_listener.js +++ b/quickshell/services/js/kwin_state_listener.js @@ -6,8 +6,12 @@ function updateWindows() { var wins = workspace.windowList(); var activeWin = workspace.activeWindow; - if (activeWin && !activeWin.skipTaskbar) { - actApp = (activeWin.resourceClass || activeWin.desktopFileName || "").toLowerCase(); + if (activeWin) { + 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) { isFullscreen = true; } @@ -18,12 +22,16 @@ function updateWindows() { if (w.fullScreen && (w.active || w === activeWin)) { isFullscreen = true; } - if ((w.normalWindow || w.fullScreen || w.managed) && !w.skipTaskbar) { - var cls = (w.resourceClass || w.desktopFileName || "").toLowerCase(); + if (w.normalWindow || w.fullScreen || w.managed) { + var cls = (w.desktopFileName || w.resourceClass || w.resourceName || "").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 (openApps.indexOf(cls) === -1) { - openApps.push(cls); + 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) { + openApps.push(cls); + } } } } diff --git a/quickshell/services/python/active_window_service.py b/quickshell/services/python/active_window_service.py index f289206..b8665ce 100755 --- a/quickshell/services/python/active_window_service.py +++ b/quickshell/services/python/active_window_service.py @@ -138,6 +138,44 @@ def resolve_game_info(app_lower): "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 if 'lutris' in app_lower: 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 - 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 { "appId": app_lower, - "name": app_lower.capitalize() + " Game", + "name": clean_name if clean_name else "Game", "icon": "com.valvesoftware.Steam" }