YaLTeR / niri

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

Support the remote desktop portal #390

Open thepragmaticmero opened 4 months ago

thepragmaticmero commented 4 months ago

System Information

I tested RustDesk experimental screen sharing on Gnome and KDE and in the current version it works, but not on niri... I don't know why, I also tested OBS-studiio on niri and it works, but RustDesk doesn't. Why could be that?. Some shenanigans about xdg-desktop-portal? The popup appears on Gnome and KDE tho... I'm pretty confused.

Also as a curiosity where could I consult the "Always remember this selection" list? If I for example wanted to see all the programs that I previously gave permission to use my screen on wayland. Gnome makes automatic use of it with it's gnome-remote-desktop service.... how did the gnome team manage to 'inject' the "remember this selection" by default with that program?

Uploading 2024-05-24.mp4…

thepragmaticmero commented 4 months ago

Uploading 2024-05-24.mp4… https://streamable.com/m51o5p 1.5x speed to save your time

YaLTeR commented 4 months ago

Could you post niri output? journalctl --no-hostname -eb /usr/bin/niri

thepragmaticmero commented 4 months ago

Using journalctl --no-hostname -eb /usr/bin/niri | wl-copy to get output after trying to connect to rustdesk

May 25 08:48:20 niri[4233]: 2024-05-25T13:48:20.541225Z  INFO niri: starting version 0.1.6 (d96a66d)
May 25 08:48:20 niri[4233]: 2024-05-25T13:48:20.653983Z DEBUG niri_config: loaded config from "/home/tecsup/.config/niri/config.kdl"
May 25 08:48:20 niri[4233]: 2024-05-25T13:48:20.951077Z  INFO niri::backend::tty: using as the render node: "/dev/dri/renderD128"
May 25 08:48:21 niri[4233]: 2024-05-25T13:48:21.109057Z DEBUG niri::backend::tty: device added: 57857 "/dev/dri/card1"
May 25 08:48:21 niri[4233]: 2024-05-25T13:48:21.530864Z DEBUG niri::backend::tty: this is the primary node
May 25 08:48:21 niri[4233]: 2024-05-25T13:48:21.530908Z DEBUG niri::backend::tty: this is the primary render node
May 25 08:48:21 niri[4233]: 2024-05-25T13:48:21.671044Z DEBUG niri::backend::tty: device changed: 57857
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.450823Z DEBUG niri::backend::tty: connecting connector: eDP-1
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.450981Z DEBUG niri::backend::tty: picking mode: Mode { name: "1366x768", clock: 76320, size: (1366, 768), hsync: (1414, 1446, 1610), vsync: (771, 776, 790), hskew: 0, vscan: 0, vrefresh: 60, mode_type: ModeTypeFlags(PREFERRED | DRIVER) }
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.451241Z DEBUG niri::backend::tty: set max bpc to 8
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.462143Z DEBUG niri::niri: putting output eDP-1 at x=0 y=0
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.462420Z  INFO niri: listening on Wayland socket: wayland-1
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.462459Z  INFO niri: IPC listening on: /run/user/1000/niri.wayland-1.4233.sock
May 25 08:48:22 niri[4233]: libinput error: client bug: timer event4 keyboard: scheduled expiry is in the past (-1300ms), your system is too slow
May 25 08:48:22 niri[4233]: libinput error: client bug: timer event4 keyboard: scheduled expiry is in the past (-981ms), your system is too slow
May 25 08:48:22 niri[4233]: libinput error: client bug: timer event4 keyboard: scheduled expiry is in the past (-536ms), your system is too slow
May 25 08:48:22 niri[4233]: libinput error: client bug: timer event4 keyboard: scheduled expiry is in the past (-287ms), your system is too slow
May 25 08:48:22 niri[4233]: libinput error: client bug: timer event4 keyboard: scheduled expiry is in the past (-197ms), your system is too slow
May 25 08:48:22 niri[4233]: libinput error: WARNING: log rate limit exceeded (5 msgs per 3600000ms). Discarding future messages.
May 25 08:50:07 niri[4233]: error in client communication (pid 4954)
May 25 08:57:10 niri[4233]: error in client communication (pid 5272)
May 25 08:58:33 niri[4233]: error in client communication (pid 5538)
thepragmaticmero commented 4 months ago

Using same journalctl command after OBS getting pipewire/wayland permission

May 25 08:48:20 niri[4233]: 2024-05-25T13:48:20.541225Z  INFO niri: starting version 0.1.6 (d96a66d)
May 25 08:48:20 niri[4233]: 2024-05-25T13:48:20.653983Z DEBUG niri_config: loaded config from "/home/tecsup/.config/niri/config.kdl"
May 25 08:48:20 niri[4233]: 2024-05-25T13:48:20.951077Z  INFO niri::backend::tty: using as the render node: "/dev/dri/renderD128"
May 25 08:48:21 niri[4233]: 2024-05-25T13:48:21.109057Z DEBUG niri::backend::tty: device added: 57857 "/dev/dri/card1"
May 25 08:48:21 niri[4233]: 2024-05-25T13:48:21.530864Z DEBUG niri::backend::tty: this is the primary node
May 25 08:48:21 niri[4233]: 2024-05-25T13:48:21.530908Z DEBUG niri::backend::tty: this is the primary render node
May 25 08:48:21 niri[4233]: 2024-05-25T13:48:21.671044Z DEBUG niri::backend::tty: device changed: 57857
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.450823Z DEBUG niri::backend::tty: connecting connector: eDP-1
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.450981Z DEBUG niri::backend::tty: picking mode: Mode { name: "1366x768", clock: 76320, size: (1366, 768), hsync: (1414, 1446, 1610), vsync: (771, 776, 790), hskew: 0, vscan: 0, vrefresh: 60, mode_type: ModeTypeFlags(PREFERRED | DRIVER) }
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.451241Z DEBUG niri::backend::tty: set max bpc to 8
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.462143Z DEBUG niri::niri: putting output eDP-1 at x=0 y=0
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.462420Z  INFO niri: listening on Wayland socket: wayland-1
May 25 08:48:22 niri[4233]: 2024-05-25T13:48:22.462459Z  INFO niri: IPC listening on: /run/user/1000/niri.wayland-1.4233.sock
May 25 08:48:22 niri[4233]: libinput error: client bug: timer event4 keyboard: scheduled expiry is in the past (-1300ms), your system is too slow
May 25 08:48:22 niri[4233]: libinput error: client bug: timer event4 keyboard: scheduled expiry is in the past (-981ms), your system is too slow
May 25 08:48:22 niri[4233]: libinput error: client bug: timer event4 keyboard: scheduled expiry is in the past (-536ms), your system is too slow
May 25 08:48:22 niri[4233]: libinput error: client bug: timer event4 keyboard: scheduled expiry is in the past (-287ms), your system is too slow
May 25 08:48:22 niri[4233]: libinput error: client bug: timer event4 keyboard: scheduled expiry is in the past (-197ms), your system is too slow
May 25 08:48:22 niri[4233]: libinput error: WARNING: log rate limit exceeded (5 msgs per 3600000ms). Discarding future messages.
May 25 08:50:07 niri[4233]: error in client communication (pid 4954)
May 25 08:57:10 niri[4233]: error in client communication (pid 5272)
May 25 08:58:33 niri[4233]: error in client communication (pid 5538)
May 25 09:01:30 niri[4233]: error in client communication (pid 12597)
May 25 09:01:47 niri[4233]: 2024-05-25T14:01:47.424957Z DEBUG niri::dbus::mutter_screen_cast: record_monitor connector="eDP-1" properties=RecordMonitorProperties { cursor_mode: Some(Metadata), _is_recording: None }
May 25 09:01:47 niri[4233]: 2024-05-25T14:01:47.430048Z DEBUG niri::dbus::mutter_screen_cast: start
May 25 09:01:47 niri[4233]: 2024-05-25T14:01:47.430526Z DEBUG niri::niri: StartCast session_id=0
May 25 09:01:47 niri[4233]: 2024-05-25T14:01:47.430645Z DEBUG niri::pw_utils: pw stream: state changed: Unconnected -> Connecting
May 25 09:01:47 niri[4233]: 2024-05-25T14:01:47.453595Z DEBUG niri::pw_utils: pw stream: state changed: Connecting -> Paused
May 25 09:01:47 niri[4233]: 2024-05-25T14:01:47.453705Z DEBUG niri::pw_utils: pw stream: sending signal with 79
May 25 09:01:47 niri[4233]: 2024-05-25T14:01:47.757243Z DEBUG niri::pw_utils: pw stream: state changed: Paused -> Streaming
YaLTeR commented 4 months ago

Weird, I don't see any screencast start attempts in the first log. Maybe it uses a different portal (remote desktop?) that niri doesn't yet implement.

thepragmaticmero commented 4 months ago

As I said, it works fine on xdg-desktop-portal-kde and xdg-desktop-portal-gnome (Gnome and KDE), I tested them rebooting every time and accessing them via gdm/sddm and yet the only one that doesn't work is with Niri O-O. Weird huh, could you replicate it?. Maybe some other bugs could be solved by fixing this.

YaLTeR commented 4 months ago

As I said, it works fine on xdg-desktop-portal-kde and xdg-desktop-portal-gnome (Gnome and KDE),

I mean, if niri doesn't implement the remote desktop backend, then there's nothing xdp-gnome can do but return an error. It might show up in RustDesk's logs or xdp-gnome's logs.

YaLTeR commented 3 months ago

I tried it myself and yeah, it uses the remote desktop portal, so niri would need to implement Mutter's remote desktop backend.

thepragmaticmero commented 5 days ago

Cute guide I made for rawdogging remote desktop