System Information
Ignis 0.5+g57017f8.d20250917
Current desktop: niri
os-release:
ANSI_COLOR="0;38;2;126;186;228"
BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="25.05.20250920.b2a3852"
CPE_NAME="cpe:/o:nixos:nixos:25.05"
DEFAULT_HOSTNAME=nixos
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
ID_LIKE=""
IMAGE_ID=""
IMAGE_VERSION=""
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 25.05 (Warbler)"
SUPPORT_END="2025-12-31"
SUPPORT_URL="https://nixos.org/community.html"
VARIANT=""
VARIANT_ID=""
VENDOR_NAME=NixOS
VENDOR_URL="https://nixos.org/"
VERSION="25.05 (Warbler)"
VERSION_CODENAME=warbler
VERSION_ID="25.05"
Description
When a new window is spawned (and automatically focused), the new as well as the old window is tagged as focused window by NiriService.
Let's say I am currently focused on a window with window.id == 1, and I spawn a new window with window.id == 2.
Then ignis.services.niri.NiriService does not reset the is_focused property of the window with window.id == 1. Leaving window.is_focused == True for both window 1 and window 2.
In short, ignis now thinks that more than one windows are in focus simultaneously.
How to reproduce
- Download this config.py
- Run
ignis init -c /path/to/above/config.py under niri.
- Monitor the terminal output, you are watching a list of ids of windows for which
window.is_focused == True
- Create a new window.
- Now, you can see in the terminal output, the list contains two window ids.
Additional Information
I looked into the source code and here is my RCA:
On creation of new window, Niri IPC generates a WindowOpenedOrChanged signal, and after receiving this event ignis.services.niri.NiriService calls self.__update_window method (source).
But Niri IPC does not generate WindowFocusChanged event (source) on spawning of new window. This means ignis.services.niri.NiriService does not trigger self.__update_window_focus method, as it only triggers on WindowFocusChanged event.
Proposed fix: inside this if condition, in self.__update_window method add just one more line
if window.is_focused:
self.__update_window_focus(window_data) # <-- This is the new line
self._active_window.sync(window_data)
So basically, just trigger an update to window focus, on WindowOpenedOrChanged.
I might create an PR with this change.
System Information
Ignis 0.5+g57017f8.d20250917
Current desktop: niri
os-release:
ANSI_COLOR="0;38;2;126;186;228"
BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="25.05.20250920.b2a3852"
CPE_NAME="cpe:/o:nixos:nixos:25.05"
DEFAULT_HOSTNAME=nixos
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
ID_LIKE=""
IMAGE_ID=""
IMAGE_VERSION=""
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 25.05 (Warbler)"
SUPPORT_END="2025-12-31"
SUPPORT_URL="https://nixos.org/community.html"
VARIANT=""
VARIANT_ID=""
VENDOR_NAME=NixOS
VENDOR_URL="https://nixos.org/"
VERSION="25.05 (Warbler)"
VERSION_CODENAME=warbler
VERSION_ID="25.05"
Description
When a new window is spawned (and automatically focused), the new as well as the old window is tagged as focused window by
NiriService.Let's say I am currently focused on a window with
window.id == 1, and I spawn a new window withwindow.id == 2.Then
ignis.services.niri.NiriServicedoes not reset theis_focusedproperty of the window withwindow.id == 1. Leavingwindow.is_focused == Truefor both window 1 and window 2.In short, ignis now thinks that more than one windows are in focus simultaneously.
How to reproduce
ignis init -c /path/to/above/config.pyunder niri.window.is_focused == TrueAdditional Information
I looked into the source code and here is my RCA:
On creation of new window, Niri IPC generates a
WindowOpenedOrChangedsignal, and after receiving this eventignis.services.niri.NiriServicecallsself.__update_windowmethod (source).But Niri IPC does not generate
WindowFocusChangedevent (source) on spawning of new window. This meansignis.services.niri.NiriServicedoes not triggerself.__update_window_focusmethod, as it only triggers onWindowFocusChangedevent.Proposed fix: inside this if condition, in
self.__update_windowmethod add just one more lineSo basically, just trigger an update to window focus, on
WindowOpenedOrChanged.I might create an PR with this change.