fix: resolve Overwatch and game window detection on taskbar by relaxing KWin skipTaskbar filtering
This commit is contained in:
parent
07ed2467e4
commit
9956338dcf
@ -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,16 +22,20 @@ 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 (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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
callDBus("io.quickshell.ActiveApp", "/ActiveApp", "io.quickshell.ActiveApp", "updateState", actApp, JSON.stringify(openApps), isFullscreen ? "true" : "false");
|
||||
}
|
||||
|
||||
@ -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"
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user