apps/telegram.lua: focus_on_activate is not a window rule, so the Telegram focus-steal opt-out is a no-op (also affects #13688, #14283)
What's wrong?
default/hypr/apps/telegram.lua is one line and has never had any effect:
-- Prevent Telegram from stealing focus on new messages.
o.window("org.telegram.desktop", { focus_on_activate = false })
focus_on_activate is not a window rule. It exists only as the global
misc:focus_on_activate option. Hyprland does not error on an unrecognised
window-rule key, so the rule parses, hyprctl configerrors stays clean, and
Telegram still takes focus and moves the active workspace on every incoming
message.
This matters beyond Telegram, because the same key is used as a window rule in two open PRs:
- #13688 —
o.window({ fullscreen = true }, { focus_on_activate = false, ... }) - #14283 — two browser rules,
o.window("^(...)$", { focus_on_activate = false })
and #14282 cites apps/telegram.lua as evidence that Omarchy "already treats
app-initiated focus stealing as a bug and patches it app by app". That premise
does not hold: the per-app opt-out mechanism it points at is inert.
Worth noting for #14283 specifically: its test
(test/shell.d/hyprland-browser-focus-test.sh) loads the app rules against a
stub hl and asserts which windows opt out. That checks rule registration,
so it passes regardless of whether Hyprland accepts the key at runtime.
Evidence
The windowrule spelling does not exist in the compositor binary; the misc option does:
$ strings /usr/bin/Hyprland | grep -ci focusonactivate
0
$ strings /usr/bin/Hyprland | grep -ci focus_on_activate
1
$ hyprctl getoption misc:focus_on_activate
bool: true
set: true
Hyprland's own Lua stubs agree — focus_on_activate is declared under
HL.ConfigOpt.Misc in /usr/share/hypr/stubs/hl.meta.lua, not under the
window-rule spec.
Hyprland event socket during an incoming message, stock rule active:
urgent>>_
activewindow>>org.telegram.desktop_,_
workspace>>_
Steps to reproduce
- Run Telegram Desktop on stock Omarchy.
- Focus a window on another workspace.
- Receive a Telegram message.
- Focus and the active workspace both jump to Telegram.
Suggested fix
suppressevent is the mechanism that works:
o.window("^org\\.telegram\\.desktop.*$", {
suppress_event = "maximize activate activatefocus",
})
Verified working on the system below. Two notes on that patch:
maximizeis retained deliberately:default/hypr/windows.luasetssuppress_event = "maximize"for all windows, and an app-specificsuppress_eventreplaces rather than merges with it.- The trailing
.*matters, and is a second independent reason the shipped rule misses. Hyprland full-matches the class regex, and Telegram Desktop appends a hash of its install path to its app-id when it is not installed system-wide (org.telegram.desktop._<hash>), so a bareorg.telegram.desktopcannot match those installs even with a valid key. Confirmed with a tag probe against a live window: a rule matching^org\.telegram\.desktopdid not apply its tag, the same rule with a trailing.*did.
If #14282 is resolved by defaulting misc:focus_on_activate to false, the
Telegram rule becomes redundant rather than correct — but as long as per-app
opt-outs are the strategy, they need a key Hyprland actually honours.
System details
Omarchy 4.0.4-1 (quattro), Hyprland 0.56.2-2.
Disclosure: investigated and drafted with an AI coding agent at my direction, from measurements on my own machine; I reviewed the text and the quoted output.
Correcting one part of this, because it names #14283: on the version in your report the key is not the reason a rule would be inert.
focus_on_activate is a window-rule effect in 0.56.2. In the v0.56.2 tag:
src/desktop/rule/windowRule/WindowRuleEffectContainer.cpp:46—"focus_on_activate"is in the effect-name table.src/config/lua/bindings/LuaBindingsInternal.hpp:84— the Lua binding maps that key toWINDOW_RULE_EFFECT_FOCUS_ON_ACTIVATE, so a Lua rule using it is a recognised property, not a dropped key.src/desktop/view/Window.cpp:1375— focus is granted onm_ruleApplicator->focusOnActivate().valueOr(*CConfigValue("misc:focus_on_activate")), i.e. the per-window value overrides the global option.src/debug/HyprCtl.cpp:1585—hyprctl getprop <address> focus_on_activatereads the per-window value back.
The strings argument is what misleads here: the rule name is snake case, so strings /usr/bin/Hyprland | grep -ci focusonactivate returns 0 whatever the binary supports, and grep -ci focus_on_activate counts matching lines, so literals that share a string-pool entry can add up to 1.
Your Telegram repro stays plausible for the second reason the report already gives: Hyprland full-matches the class, and Telegram appends an install-path hash to its app-id when it is not installed system-wide, so a bare org.telegram.desktop misses those windows even with a valid key. That part is worth keeping.
Not closing this or touching apps/telegram.lua from here — only noting that the no-op half does not extend to #14283, whose patterns match the classes they name (measured taking effect on 0.56.2: https://github.com/omacom/omarchy/discussions/16078).
Checked against Hyprland v0.56.2's source and Telegram Desktop's, by Claude Opus 5.5 and independently by Codex Medium, which reached the same verdict on both halves (its independence from this session is not guaranteed).
The rule key is valid. focus_on_activate is a window rule in 0.56.2, as @kouyichi says: it is in the effect table (src/desktop/rule/windowRule/WindowRuleEffectContainer.cpp:46), bound for Lua (src/config/lua/bindings/LuaBindingsInternal.hpp:84), and CWindow::activate returns before taking focus when focusOnActivate().valueOr(misc:focus_on_activate) is false (src/desktop/view/Window.cpp:1375). A rule that matches does override the global option.
The class pattern is the real defect. Hyprland matches with RE2::FullMatch (src/desktop/rule/matchEngine/RegexMatchEngine.cpp), and Telegram Desktop names itself org.telegram.desktop._<hash> whenever its built-in updater is enabled (Telegram/SourceFiles/platform/linux/specific_linux.cpp, Platform::start), which is the case for the tarball from telegram.org. Those windows miss org.telegram.desktop, so they keep stealing focus. A build without Telegram's release target, such as Arch's telegram-desktop package, has the updater off by default (desktop-app/cmake_helpers variables.cmake) and is named org.telegram.desktop, and the Flatpak takes its FLATPAK_ID, so the rule already applies to both.
#15662 fixes this issue and is linked to close it. It is reviewed as its own item; two things there are worth knowing now: its explanation repeats the claim that the key does nothing, which is not so, and its test checks org.telegram.desktop_def0123, which lacks the dot Telegram actually writes before the underscore. Keeping focus_on_activate = false and matching org\\.telegram\\.desktop(\\._.+)? would cover both spellings without changing the mechanism.
Labelled bug. Nothing further is needed from you; this waits on the maintainer's decision on #15662.