YaLTeR / niri

A scrollable-tiling Wayland compositor.
https://matrix.to/#/#niri:matrix.org
GNU General Public License v3.0
4.14k stars 123 forks source link

Support for multiple displays #783

Closed BlackCherryCat closed 2 weeks ago

BlackCherryCat commented 2 weeks ago

Does niri have support for multiple screens? because I was trying to enter to niri and I couldn't enter to it and when I disconnected the second display I was able to enter to Niri. In my Journalctl I have this:

nov 06 02:36:47 BlackCherryArch niri[779]: 2024-11-06T01:36:47.641804Z  INFO niri: starting version 0.1.9 (unknown commit)
nov 06 02:36:47 BlackCherryArch niri[779]: 2024-11-06T01:36:47.660350Z DEBUG niri_config: loaded config from "/home/cherry/.config/niri/config.kdl"
nov 06 02:36:47 BlackCherryArch niri[779]: 2024-11-06T01:36:47.810076Z  INFO niri::backend::tty: using as the render node: "/dev/dri/renderD128"
nov 06 02:36:47 BlackCherryArch niri[779]: 2024-11-06T01:36:47.864292Z DEBUG niri::backend::tty: device added: 57856 "/dev/dri/card0"
nov 06 02:36:48 BlackCherryArch niri[779]: 2024-11-06T01:36:48.029168Z DEBUG niri::backend::tty: this is the primary node
nov 06 02:36:48 BlackCherryArch niri[779]: 2024-11-06T01:36:48.029178Z DEBUG niri::backend::tty: this is the primary render node
nov 06 02:36:48 BlackCherryArch niri[779]: 2024-11-06T01:36:48.125909Z DEBUG niri::backend::tty: device changed: 57856
nov 06 02:36:48 BlackCherryArch niri[779]: 2024-11-06T01:36:48.164390Z DEBUG niri::backend::tty: connecting connector: DP-1
nov 06 02:36:48 BlackCherryArch niri[779]: 2024-11-06T01:36:48.164563Z DEBUG niri::backend::tty: picking mode: Mode { name: "1920x1080", clock: 148500, size: (1920, 1080), hsync: (2008, 2052, 2200), vsync: (1084, 1089, 1125), hskew: 0,>
nov 06 02:36:48 BlackCherryArch niri[779]: 2024-11-06T01:36:48.164579Z DEBUG niri::backend::tty: error setting max bpc: couldn't find max bpc property
nov 06 02:36:48 BlackCherryArch niri[779]: 2024-11-06T01:36:48.168591Z DEBUG niri::niri: putting output DP-1 at x=0 y=0
nov 06 02:36:48 BlackCherryArch niri[779]: 2024-11-06T01:36:48.168646Z  INFO niri: listening on Wayland socket: wayland-1
nov 06 02:36:48 BlackCherryArch niri[779]: 2024-11-06T01:36:48.168649Z  INFO niri: IPC listening on: /run/user/1000/niri.wayland-1.779.sock
nov 06 02:37:32 BlackCherryArch niri[779]: 2024-11-06T01:37:32.586060Z DEBUG niri::backend::tty: device changed: 57856
nov 06 02:37:32 BlackCherryArch niri[779]: 2024-11-06T01:37:32.725345Z DEBUG niri::backend::tty: connecting connector: DP-2
nov 06 02:37:32 BlackCherryArch niri[779]: 2024-11-06T01:37:32.725380Z DEBUG niri::backend::tty: picking mode: Mode { name: "1920x1080", clock: 148500, size: (1920, 1080), hsync: (2008, 2052, 2200), vsync: (1084, 1089, 1125), hskew: 0,>
nov 06 02:37:32 BlackCherryArch niri[779]: 2024-11-06T01:37:32.725395Z DEBUG niri::backend::tty: error setting max bpc: couldn't find max bpc property
nov 06 02:37:32 BlackCherryArch niri[779]: 2024-11-06T01:37:32.726937Z DEBUG niri::niri: putting output DP-2 at x=1920 y=0
nov 06 02:37:32 BlackCherryArch niri[779]: 2024-11-06T01:37:32.727003Z DEBUG niri::backend::tty: device changed: 57856
nov 06 02:37:32 BlackCherryArch niri[779]: thread 'main' panicked at src/layout/monitor.rs:906:34:
nov 06 02:37:32 BlackCherryArch niri[779]: index out of bounds: the len is 0 but the index is 0
nov 06 02:37:32 BlackCherryArch niri[779]: stack backtrace:
nov 06 02:37:32 BlackCherryArch niri[779]: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
nov 06 02:37:32 BlackCherryArch niri[779]: 2024-11-06T01:37:32.931637Z DEBUG niri::utils::watcher: exiting watcher thread for /home/cherry/.config/niri/config.kdl
nov 06 02:43:05 BlackCherryArch niri[3022]: 2024-11-06T01:43:05.261014Z  WARN niri: running as a session but DISPLAY is set, removing it
nov 06 02:43:05 BlackCherryArch niri[3022]: 2024-11-06T01:43:05.261026Z  WARN niri: running as a session but WAYLAND_DISPLAY is set, removing it
nov 06 02:43:05 BlackCherryArch niri[3022]: 2024-11-06T01:43:05.261034Z  INFO niri: starting version 0.1.9 (unknown commit)
nov 06 02:43:05 BlackCherryArch niri[3022]: 2024-11-06T01:43:05.278580Z DEBUG niri_config: loaded config from "/home/cherry/.config/niri/config.kdl"
nov 06 02:43:05 BlackCherryArch niri[3022]: thread 'main' panicked at src/main.rs:183:6:
nov 06 02:43:05 BlackCherryArch niri[3022]: called `Result::unwrap()` on an `Err` value: error initializing the TTY backend
nov 06 02:43:05 BlackCherryArch niri[3022]: Caused by:
nov 06 02:43:05 BlackCherryArch niri[3022]:     0: Error creating a session. This might mean that you're trying to run niri on a TTY that is already busy, for example if you're running this inside tmux that had been originally started >
nov 06 02:43:05 BlackCherryArch niri[3022]:     1: Failed to open session: Function not implemented (os error 38)

System Information

YaLTeR commented 2 weeks ago

This crash happens when two monitors have exactly matching model + make + serial, which I did not know could happen when I added support for them throughout the code base. A proper fix would take some time (I think someone started working on it); for now I'll add a debug flag workaround.

YaLTeR commented 2 weeks ago

I added a workaround debug flag in 8867a4f84c4bd07235abd37828b0d724321facbe. Putting this in your config should make it work:

debug {
    disable-monitor-names
}

As for the proper fix, it's tracked in #734.