From 1e30a9017b60bbb601fc52b6182a11015ab564c7 Mon Sep 17 00:00:00 2001 From: rope Date: Sat, 1 Aug 2026 20:32:23 +0100 Subject: [PATCH] hyprland: fix Battle.net activation rule matching a stale class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Battle.net now maps as steam_app_default, not steam_app_0, so the suppress_event rule stopped applying — its activation spam clears quickshell's focus grab, which kills the launcher in the same frame it opens. Match either class; same for the tray-icon rule. --- settings/hyprland.nix | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 6cd6922..ca79036 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -269,7 +269,7 @@ in -- Battle.net tray icon leaks as a tiny floating XWayland window. hl.window_rule({ - match = { class = "steam_app_0", title = "^$", float = true }, + match = { class = "^steam_app_(0|default)$", title = "^$", float = true }, workspace = "special silent", }) @@ -287,11 +287,28 @@ in suppress_event = "fullscreen maximize", }) - -- Battle.net (a non-Steam shortcut, so class steam_app_0) spams - -- window-activation events that clear quickshell's focus grab and - -- instantly close the launcher / power menu. Drop those events. + -- Battle.net spams window-activation events for as long as it is + -- running. Each one clears quickshell's focus grab, which closes the + -- launcher / power menu exactly like a click-outside would — so with + -- Battle.net open, Super+R appears to do nothing at all: the panel + -- opens and is killed within the same frame. Drop those events. + -- + -- Matched on class, not title: a title-scoped rule would have to be + -- re-evaluated after the CEF window sets its title, and this needs to + -- hold from map onwards. It also catches the launcher's login and + -- update windows, which are the same class under other titles. + -- + -- Non-Steam shortcuts have been BOTH steam_app_0 and + -- steam_app_default across Steam versions (this rule matched only + -- steam_app_0, and silently stopped applying when Battle.net turned + -- up as steam_app_default — that regression is the bug this alt + -- fixes). Match either so a Steam update can't break it again. + -- + -- WoW shares steam_app_default and so loses self-activation too. + -- Harmless: a game window is focused when it maps, which is not an + -- activation request, and alt-tab is compositor-side. hl.window_rule({ - match = { class = "steam_app_0" }, + match = { class = "^steam_app_(0|default)$" }, suppress_event = "activate activatefocus", })