GithubHelp home page GithubHelp logo

Chrome OS support about lan-mouse HOT 29 OPEN

bpstrngr avatar bpstrngr commented on May 28, 2024
Chrome OS support

from lan-mouse.

Comments (29)

feschber avatar feschber commented on May 28, 2024 1

ChromeOS would need to support either

And either

Neither of which is very likely to happen anytime soon.

The error you are seeing is because xdg-output
is currently used to detect the dimensions of monitors attached to a PC. I can fallback to wl-output which must be supported by any wayland compositor.

That would lead to the next error though, which is that wlr-layer-shell is not supported.
For that I could craft another fallback to a simple xdg-toplevel (normal application window) that you would move the mouse into to control another PC. (not very elegant but a somewhat useful fallback).

So in short the options to get input capture working are:

  • Implement wl-output fallback for xdg-output
  • Implement xdg-toplevel fallback for wlr-layershell

For input emulation I have less hope other than chromeos supporting either xdg remote desktop or Libei at some point.

The other error you are seeing is very peculiar and seems to be an issue with cargo on chromeos.
You could comment out the "reis" dependency from Cargo.toml to work around it (its only needed for libei, which is not supported anyway).

With that the GUI should now launch as well.

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

Disabling individual features does not seem to be possible as of now:
rust-lang/cargo#3126

There is two Options:

  • either build with --no-default-features and add all the features manually:
cargo build --release --no-default-features --features wayland,x11,xdg_desktop_portal

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

If you could tell me what Distro you're using, I may be able to help you with getting libadwaita installed.

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

If you could tell me what Distro you're using, I may be able to help you with getting libadwaita installed.

Sorry I overlooked chrome os.

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

Do you have an update on this?
I'm curious if chrome os works but I feel like they probably dont support the necessary wayland protocols or desktop portals.

from lan-mouse.

jpeeler avatar jpeeler commented on May 28, 2024

I tried running in a Crostini container (with libadwaita-1-0 installed) and got this:

$ ./lan-mouse 
[2023-12-15T20:20:04Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-15T20:20:04Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-15T20:20:04Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-15T20:20:04Z WARN  lan_mouse::config] Continuing without config file ...
thread 'main' panicked at /var/home/jpeeler/src/lan-mouse/src/producer.rs:58:13:
could not detect session type: XDG_SESSION_TYPE environment variable not set!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
^C
jpeeler@jeff:~$ XDG_SESSION_TYPE=wayland ./lan-mouse 
[2023-12-15T20:20:43Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-15T20:20:43Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-15T20:20:43Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-15T20:20:43Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-15T20:20:43Z INFO  lan_mouse::producer] XDG_SESSION_TYPE = wayland -> using wayland event producer
[2023-12-15T20:20:43Z INFO  lan_mouse::producer] XDG_CURRENT_DESKTOP = X-Generic -> using layer_shell backend
[2023-12-15T20:20:43Z INFO  lan_mouse::consumer] XDG_SESSION_TYPE = wayland -> using wayland event consumer
[2023-12-15T20:20:43Z WARN  lan_mouse::consumer] unknown XDG_CURRENT_DESKTOP -> defaulting to wlroots backend
[2023-12-15T20:20:43Z ERROR lan_mouse] xdg_output not supported!

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

I tried running in a Crostini container (with libadwaita-1-0 installed) and got this:

$ ./lan-mouse 
[2023-12-15T20:20:04Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-15T20:20:04Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-15T20:20:04Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-15T20:20:04Z WARN  lan_mouse::config] Continuing without config file ...
thread 'main' panicked at /var/home/jpeeler/src/lan-mouse/src/producer.rs:58:13:
could not detect session type: XDG_SESSION_TYPE environment variable not set!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
^C
jpeeler@jeff:~$ XDG_SESSION_TYPE=wayland ./lan-mouse 
[2023-12-15T20:20:43Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-15T20:20:43Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-15T20:20:43Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-15T20:20:43Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-15T20:20:43Z INFO  lan_mouse::producer] XDG_SESSION_TYPE = wayland -> using wayland event producer
[2023-12-15T20:20:43Z INFO  lan_mouse::producer] XDG_CURRENT_DESKTOP = X-Generic -> using layer_shell backend
[2023-12-15T20:20:43Z INFO  lan_mouse::consumer] XDG_SESSION_TYPE = wayland -> using wayland event consumer
[2023-12-15T20:20:43Z WARN  lan_mouse::consumer] unknown XDG_CURRENT_DESKTOP -> defaulting to wlroots backend
[2023-12-15T20:20:43Z ERROR lan_mouse] xdg_output not supported!

You are on a Chromebook as well?

from lan-mouse.

jpeeler avatar jpeeler commented on May 28, 2024

Yeah (don't think Crostini exists anywhere else). I compiled the binary on a more powerful linux host and copied over the binary - I assume that doesn't matter.

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

Could you run wayland-info in that container and list the supported interfaces here?

For input capture either the wlr_layer_shell protocol would need to be implemented or libei support is required
and for input emulation the best bet is probably the remote desktop portal but I don't think that is available in chrome os either.

I would not get my hopes up too much that any of this works in Chrome OS unfortunately.

from lan-mouse.

jpeeler avatar jpeeler commented on May 28, 2024
$ wayland-info
interface: 'wl_compositor',                              version:  4, name:  1
interface: 'wl_shm',                                     version:  1, name:  2
        formats (fourcc):
        0x36314752 = 'RG16'
                 1 = 'XR24'
                 0 = 'AR24'
        0x34324258 = 'XB24'
        0x34324241 = 'AB24'
        0x3231564e = 'NV12'
interface: 'wl_drm',                                     version:  2, name:  3
interface: 'wl_subcompositor',                           version:  1, name:  4
interface: 'wl_output',                                  version:  3, name:  5
        x: 0, y: 0, scale: 2,
        physical_width: 260 mm, physical_height: 173 mm,
        make: 'unknown', model: 'unknown',
        subpixel_orientation: unknown, output_transform: normal,
        mode:
                width: 2400 px, height: 1600 px, refresh: 60.000 Hz,
                flags: current preferred
interface: 'wl_data_device_manager',                     version:  3, name:  6
interface: 'wp_fractional_scale_manager_v1',             version:  1, name:  7
interface: 'wp_viewporter',                              version:  1, name:  8
interface: 'zwp_tablet_manager_v2',                      version:  1, name:  9
        tablet_seat: default
                tablet: Touchscreen
                        vendor: 0
                        product: 0
                tablet_tool: eraser
                        capabilities: tilt pressure
                tablet_tool: pen
                        capabilities: tilt pressure
interface: 'wl_seat',                                    version:  5, name: 10
        name: default
        capabilities: pointer keyboard touch
        keyboard repeat rate: 20
        keyboard repeat delay: 500
interface: 'gtk_shell1',                                 version:  1, name: 11
interface: 'wl_shell',                                   version:  1, name: 12
interface: 'zwp_pointer_constraints_v1',                 version:  1, name: 13
interface: 'zwp_relative_pointer_manager_v1',            version:  1, name: 14
interface: 'zwp_idle_inhibit_manager_v1',                version:  1, name: 15
interface: 'zwp_text_input_manager_v1',                  version:  1, name: 16
interface: 'zcr_text_input_crostini_manager_v1',         version:  1, name: 17
interface: 'zcr_text_input_x11_v1',                      version:  1, name: 18
interface: 'zcr_text_input_extension_v1',                version: 11, name: 19
interface: 'xdg_wm_base',                                version:  3, name: 20

I don't really have my hopes up for ChromeOS. But I am interested in the rest of the operating systems, especially Linux+MacOS. If I can help debug integration any there let me know.

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

gtk_shell1 might be a valid fallback for layer_shell but at least zwp_keyboard_shortcuts_inhibit_manager_v1 would still be required to do anything useful.

If I can help debug integration any there let me know.

Will do :) Still in pretty early development.

from lan-mouse.

bpstrngr avatar bpstrngr commented on May 28, 2024

sorry i dropped out a bit, i layed off trying to control my chromebooks for a bit, but i'm still interested and will get back to testing.
Two things i'd note is i think building on another linux distro and copying the binary may not be indifferent (statically linked libraries missing or dynamic env assumptions differing). In my build attempts i was building on crostini directly, and running from there, but you could also be right @jpeeler .
Secondly, in chromeos, crostini is a virtual machine with a little more integration than usual which makes it a viable candidate, but there is also the host "crosh" (chromeos shell) system with more limited, but at least not virtual linux environment which i was also testing against.
I'll return to keep on testing, i just missed notifications of your engagement here, but i'm happy to see the support, thanks!

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

Cheers!
You could do one more thing: Try to run with XDG_CURRENT_DESKTOP=KDE. That way we can tell whether or not the remote desktop portal is available.

At least rudimentary input capture should always be possible through an application window. I feel Iike input emulation might be the bigger problem

from lan-mouse.

jpeeler avatar jpeeler commented on May 28, 2024

Is this what you were asking about, @feschber ?

$ XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=kde ./lan-mouse 
[2023-12-16T13:32:51Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-16T13:32:51Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-16T13:32:51Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-16T13:32:51Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-16T13:32:51Z INFO  lan_mouse::producer] XDG_SESSION_TYPE = wayland -> using wayland event producer
[2023-12-16T13:32:51Z INFO  lan_mouse::producer] XDG_CURRENT_DESKTOP = kde -> using layer_shell backend
[2023-12-16T13:32:51Z INFO  lan_mouse::consumer] XDG_SESSION_TYPE = wayland -> using wayland event consumer
[2023-12-16T13:32:51Z WARN  lan_mouse::consumer] unknown XDG_CURRENT_DESKTOP -> defaulting to wlroots backend
[2023-12-16T13:32:51Z ERROR lan_mouse] xdg_output not supported!

I thought that the remote desktop portal was something to be installed. Surprisingly I do have xdg-desktop-portal-gtk and xdg-desktop-portal installed. Wondering if switching to the KDE version would be helpful, though when I set the current desktop to gnome I get the exact same output.

@bpstrngr I thought crosh was restricted to executing Chrome management utilities. You're saying there's a way to run scripts/binaries in that environment?

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

It must be capital KDE, what you want is the xdg-desktop-portal backend

from lan-mouse.

jpeeler avatar jpeeler commented on May 28, 2024
$ XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=KDE ./lan-mouse 
[2023-12-16T15:05:42Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-16T15:05:42Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-16T15:05:42Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-16T15:05:42Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-16T15:05:42Z INFO  lan_mouse::producer] XDG_SESSION_TYPE = wayland -> using wayland event producer
[2023-12-16T15:05:42Z INFO  lan_mouse::producer] XDG_CURRENT_DESKTOP = KDE -> using layer_shell backend
[2023-12-16T15:05:43Z INFO  lan_mouse::consumer] XDG_SESSION_TYPE = wayland -> using wayland event consumer
[2023-12-16T15:05:43Z INFO  lan_mouse::consumer] XDG_CURRENT_DESKTOP = KDE -> using xdg_desktop_portal backend
[2023-12-16T15:05:43Z ERROR lan_mouse] xdg_output not supported!

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

Can you rerun this with LAN_MOUSE_LOG_LEVEL=debug?

from lan-mouse.

jpeeler avatar jpeeler commented on May 28, 2024
$ LAN_MOUSE_LOG_LEVEL=debug XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=KDE ./lan-mouse 
[2023-12-16T15:21:22Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-16T15:21:22Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-16T15:21:22Z DEBUG lan_mouse] Config { frontend: Gtk, port: 4242, clients: [], daemon: false }
[2023-12-16T15:21:22Z DEBUG lan_mouse::frontend::gtk] running gtk frontend
[2023-12-16T15:21:22Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-16T15:21:22Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-16T15:21:22Z DEBUG lan_mouse] Config { frontend: Gtk, port: 4242, clients: [], daemon: true }
[2023-12-16T15:21:22Z DEBUG lan_mouse::frontend] remove socket: "/run/user/1000/lan-mouse-socket.sock"
[2023-12-16T15:21:22Z INFO  lan_mouse::producer] XDG_SESSION_TYPE = wayland -> using wayland event producer
[2023-12-16T15:21:22Z INFO  lan_mouse::producer] XDG_CURRENT_DESKTOP = KDE -> using layer_shell backend
[2023-12-16T15:21:22Z INFO  lan_mouse::consumer] XDG_SESSION_TYPE = wayland -> using wayland event consumer
[2023-12-16T15:21:22Z INFO  lan_mouse::consumer] XDG_CURRENT_DESKTOP = KDE -> using xdg_desktop_portal backend
[2023-12-16T15:21:22Z DEBUG lan_mouse::frontend] remove socket: "/run/user/1000/lan-mouse-socket.sock"
[2023-12-16T15:21:22Z ERROR lan_mouse] xdg_output not supported!
[2023-12-16T15:21:22Z DEBUG lan_mouse::frontend::gtk] connecting to lan-mouse-socket
CLI run
$ LAN_MOUSE_LOG_LEVEL=debug XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=KDE ./lan-mouse -f cli
[2023-12-16T15:21:01Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-16T15:21:01Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-16T15:21:01Z DEBUG lan_mouse] Config { frontend: Cli, port: 4242, clients: [], daemon: false }
[2023-12-16T15:21:01Z ERROR lan_mouse] Could not connect to lan-mouse-socket
jpeeler@jeff:~$ [2023-12-16T15:21:01Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-16T15:21:01Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-16T15:21:01Z DEBUG lan_mouse] Config { frontend: Cli, port: 4242, clients: [], daemon: true }
[2023-12-16T15:21:01Z DEBUG lan_mouse::frontend] remove socket: "/run/user/1000/lan-mouse-socket.sock"
[2023-12-16T15:21:01Z INFO  lan_mouse::producer] XDG_SESSION_TYPE = wayland -> using wayland event producer
[2023-12-16T15:21:01Z INFO  lan_mouse::producer] XDG_CURRENT_DESKTOP = KDE -> using layer_shell backend
[2023-12-16T15:21:01Z INFO  lan_mouse::consumer] XDG_SESSION_TYPE = wayland -> using wayland event consumer
[2023-12-16T15:21:01Z INFO  lan_mouse::consumer] XDG_CURRENT_DESKTOP = KDE -> using xdg_desktop_portal backend
[2023-12-16T15:21:01Z DEBUG lan_mouse::frontend] remove socket: "/run/user/1000/lan-mouse-socket.sock"
[2023-12-16T15:21:01Z ERROR lan_mouse] xdg_output not supported!

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

Okay, seems like I need to add some more debug information first.

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

@jpeeler you can try the latest main now. I added a fallback interface so it does not crash before we know whats going on.
XDG_CURRENT_DESKTOP=KDE is not required anymore

from lan-mouse.

jpeeler avatar jpeeler commented on May 28, 2024

(Using a6ab109).

$ LAN_MOUSE_LOG_LEVEL=debug ./lan-mouse 
[2023-12-17T19:49:05Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-17T19:49:05Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-17T19:49:05Z DEBUG lan_mouse] Config { frontend: Gtk, port: 4242, clients: [], daemon: false }
[2023-12-17T19:49:05Z DEBUG lan_mouse::frontend::gtk] running gtk frontend
[2023-12-17T19:49:05Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-17T19:49:05Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-17T19:49:05Z DEBUG lan_mouse] Config { frontend: Gtk, port: 4242, clients: [], daemon: true }
[2023-12-17T19:49:05Z DEBUG lan_mouse::frontend] remove socket: "/run/user/1000/lan-mouse-socket.sock"
[2023-12-17T19:49:05Z DEBUG lan_mouse::frontend] "/run/user/1000/lan-mouse-socket.sock": Connection refused (os error 111) - removing left behind socket
[2023-12-17T19:49:05Z INFO  lan_mouse::producer] libei event producer not available: not implemented
[2023-12-17T19:49:06Z INFO  lan_mouse::producer] layer_shell event producer not available: xdg_output not supported!
[2023-12-17T19:49:06Z INFO  lan_mouse::producer] x11 event producer not available: not implemented
[2023-12-17T19:49:06Z ERROR lan_mouse::producer] falling back to dummy event producer
[2023-12-17T19:49:06Z INFO  lan_mouse::consumer] wayland backend not available: wl_seat >= v7 not supported
[2023-12-17T19:49:06Z INFO  lan_mouse::consumer] libei not available: ZBus Error: org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.RemoteDesktop” on object at path /org/freedesktop/portal/desktop
[2023-12-17T19:49:06Z DEBUG lan_mouse::backend::consumer::xdg_desktop_portal] connecting to org.freedesktop.portal.RemoteDesktop portal ...
[2023-12-17T19:49:06Z DEBUG lan_mouse::backend::consumer::xdg_desktop_portal] creating session ...
[2023-12-17T19:49:06Z INFO  lan_mouse::consumer] remote desktop portal not available: ZBus Error: org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.RemoteDesktop” on object at path /org/freedesktop/portal/desktop
[2023-12-17T19:49:06Z INFO  lan_mouse::consumer] using x11 event consumer
[2023-12-17T19:49:06Z INFO  lan_mouse] Press Ctrl+Alt+Shift+Super to release the mouse
[2023-12-17T19:49:06Z DEBUG lan_mouse::frontend::gtk] connecting to lan-mouse-socket
[2023-12-17T19:49:06Z DEBUG lan_mouse::frontend] json: {"Enumerate":[]}, len: 16
[2023-12-17T19:49:06Z DEBUG lan_mouse::frontend::gtk] connected to lan-mouse-socket

(lan-mouse:4557): Gtk-CRITICAL **: 14:49:06.203: Error building template class 'LanMouseWindow' for an instance of type 'LanMouseWindow': .:0:0 Invalid object type 'AdwToolbarView'
thread 'main' panicked at /home/jpeeler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gtk4-0.7.2/src/subclass/widget.rs:1244:17:
Failed to retrieve template child. Please check that all fields of type `GtkButton` have been bound and have a #[template_child] attribute.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

Okay seems like the remote desktop portal is not available. XTest likely wont work either.

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

(Using a6ab109).

$ LAN_MOUSE_LOG_LEVEL=debug ./lan-mouse 
[2023-12-17T19:49:05Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-17T19:49:05Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-17T19:49:05Z DEBUG lan_mouse] Config { frontend: Gtk, port: 4242, clients: [], daemon: false }
[2023-12-17T19:49:05Z DEBUG lan_mouse::frontend::gtk] running gtk frontend
[2023-12-17T19:49:05Z ERROR lan_mouse::config] /home/jpeeler/.config/lan-mouse/config.toml: No such file or directory (os error 2)
[2023-12-17T19:49:05Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-17T19:49:05Z DEBUG lan_mouse] Config { frontend: Gtk, port: 4242, clients: [], daemon: true }
[2023-12-17T19:49:05Z DEBUG lan_mouse::frontend] remove socket: "/run/user/1000/lan-mouse-socket.sock"
[2023-12-17T19:49:05Z DEBUG lan_mouse::frontend] "/run/user/1000/lan-mouse-socket.sock": Connection refused (os error 111) - removing left behind socket
[2023-12-17T19:49:05Z INFO  lan_mouse::producer] libei event producer not available: not implemented
[2023-12-17T19:49:06Z INFO  lan_mouse::producer] layer_shell event producer not available: xdg_output not supported!
[2023-12-17T19:49:06Z INFO  lan_mouse::producer] x11 event producer not available: not implemented
[2023-12-17T19:49:06Z ERROR lan_mouse::producer] falling back to dummy event producer
[2023-12-17T19:49:06Z INFO  lan_mouse::consumer] wayland backend not available: wl_seat >= v7 not supported
[2023-12-17T19:49:06Z INFO  lan_mouse::consumer] libei not available: ZBus Error: org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.RemoteDesktop” on object at path /org/freedesktop/portal/desktop
[2023-12-17T19:49:06Z DEBUG lan_mouse::backend::consumer::xdg_desktop_portal] connecting to org.freedesktop.portal.RemoteDesktop portal ...
[2023-12-17T19:49:06Z DEBUG lan_mouse::backend::consumer::xdg_desktop_portal] creating session ...
[2023-12-17T19:49:06Z INFO  lan_mouse::consumer] remote desktop portal not available: ZBus Error: org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.RemoteDesktop” on object at path /org/freedesktop/portal/desktop
[2023-12-17T19:49:06Z INFO  lan_mouse::consumer] using x11 event consumer
[2023-12-17T19:49:06Z INFO  lan_mouse] Press Ctrl+Alt+Shift+Super to release the mouse
[2023-12-17T19:49:06Z DEBUG lan_mouse::frontend::gtk] connecting to lan-mouse-socket
[2023-12-17T19:49:06Z DEBUG lan_mouse::frontend] json: {"Enumerate":[]}, len: 16
[2023-12-17T19:49:06Z DEBUG lan_mouse::frontend::gtk] connected to lan-mouse-socket

(lan-mouse:4557): Gtk-CRITICAL **: 14:49:06.203: Error building template class 'LanMouseWindow' for an instance of type 'LanMouseWindow': .:0:0 Invalid object type 'AdwToolbarView'
thread 'main' panicked at /home/jpeeler/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gtk4-0.7.2/src/subclass/widget.rs:1244:17:
Failed to retrieve template child. Please check that all fields of type `GtkButton` have been bound and have a #[template_child] attribute.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This Gtk-CRITICAL error is because I had used widgets from libadwaita-1.4 (accidentally). If you try the latest main, you may be able to get the gui to launch.

from lan-mouse.

jpeeler avatar jpeeler commented on May 28, 2024

Yep, I was compiling against libadwaita-rs 0.5.2. The GUI does indeed launch, which is nice.

from lan-mouse.

jpeeler avatar jpeeler commented on May 28, 2024

Something I just wondered - do you know of any necessary portal versions that are required to get things to work? This linux container I'm testing with is running Debian 12. The KDE portal is 5.27.5, which seems to be around 7 months old. But maybe everything that is required has been implemented for a while and the problem is more so on the ChromeOS wayland side.

from lan-mouse.

feschber avatar feschber commented on May 28, 2024

For input emulation only the remote desktop portal is required. (org.freedesktop.portal.RemoteDesktop).
This has been around for a quite a while in xdg-desktop-portal-kde.

Do I understand correctly that you are running KDE on a Linux container in ChromeOS?

Can you check the output of qdbus?
It should list all of the available portals.

from lan-mouse.

jpeeler avatar jpeeler commented on May 28, 2024

The xdg-desktop-portal package is 1.16.0, which is about 12 months old. And I realized that I only had the -gtk portal installed earlier. However, it doesn't change the result all that much.

I am not running KDE as a desktop environment on ChromeOS if that's what you're asking. But am using their packages to run various apps (such as VLC).

$ /usr/lib/qt6/bin/qdbus
:1.10
 org.freedesktop.portal.Desktop
:1.11
 org.freedesktop.portal.Documents
:1.12
 org.freedesktop.impl.portal.PermissionStore
:1.13
 org.freedesktop.impl.portal.desktop.gtk
:1.14
:1.15
 org.a11y.Bus
:1.16
:1.17
:1.2
 org.freedesktop.systemd1
:1.37
 org.freedesktop.Flatpak
:1.4
 org.pulseaudio.Server
:1.40
 org.freedesktop.Notifications
:1.5
:1.51
 org.mozilla.firefox.ZGVmYXVsdC1yZWxlYXNl
:1.53
:1.58
:1.59
:1.6
:1.7
 org.freedesktop.ScreenSaver
:1.8
 org.freedesktop.impl.portal.desktop.cros
org.freedesktop.DBus

I don't understand why the KDE portal is not listed though.

from lan-mouse.

bpstrngr avatar bpstrngr commented on May 28, 2024

found the time to test this too, starting from the point where you taught me how to opt out of libadwaita, i compiled with cargo build --release --no-default-features --features wayland in crostini.
inside crostini, it's the same result as for jpeeler,

$ LAN_MOUSE_LOG_LEVEL=debug XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=KDE RUST_BACKTRACE=1 ./target/release/lan-mouse
[2023-12-24T14:32:51Z INFO  lan_mouse::producer] XDG_SESSION_TYPE = wayland -> using wayland event producer
[2023-12-24T14:32:51Z ERROR lan_mouse] xdg_output not supported!

The thing i can add, for what it's worth, is what happens outside crostini, on the host chromeos shell:

$ LAN_MOUSE_LOG_LEVEL=debug XDG_SESSION_TYPE=wayland XDG_CURRENT_DESKTOP=KDE ./lan-mouse
[2023-12-24T15:15:47Z ERROR lan_mouse::config] config.toml: No such file or directory (os error 2)
[2023-12-24T15:15:47Z WARN  lan_mouse::config] Continuing without config file ...
[2023-12-24T15:15:47Z INFO  lan_mouse::producer] XDG_SESSION_TYPE = wayland -> using wayland event producer
[2023-12-24T15:15:47Z ERROR lan_mouse] could not connect to wayland compositor: NoCompositor

or, when built with "x11,xdg_desktop_portal" features included:

./lan-mouse: error while loading shared libraries: libXtst.so.6: cannot open shared object file: No such file or directory

(been down the rabbit hole of building/copying such libs individually, in this case i assume the list would be long, so i just didn't include these features, X11 will certainly be ever foreign to the native chromeos shell).
And yes, @jpeeler official chromeos distributions lock the user out of the host shell, but "switching to dev mode", or chromium os builds, give access to it. it's a really minimal raspberry pi-like gentoo environment with not even portage being functional (although i commonly run nodejs/python there without any problems), so probably won't be easy to give any more diagnostics about the wayland environment.

from lan-mouse.

bpstrngr avatar bpstrngr commented on May 28, 2024

Oh, and mind you, i had to checkout the v0.3.3 tag, because on the latest main, and several commits back, cargo build --release on crostini has started failing with

$ cargo build --release --no-default-features --features wayland
    Updating crates.io index
    Updating git repository `https://github.com/ids1024/reis`
warning: spurious network error (3 tries remaining): failed to mmap. Could not write data: Invalid argument; class=Os (2)
warning: spurious network error (2 tries remaining): failed to mmap. Could not write data: Invalid argument; class=Os (2)
warning: spurious network error (1 tries remaining): failed to mmap. Could not write data: Invalid argument; class=Os (2)
error: failed to get `reis` as a dependency of package `lan-mouse v0.4.0 (/home/ranger/crostini/lan-mouse)`

Caused by:
  failed to load source for dependency `reis`

Caused by:
  Unable to update https://github.com/ids1024/reis#a12f7e41

Caused by:
  failed to fetch into: /home/ranger/shuttle/x86/../rust/x86_64-unknown-linux-gnu/cargo/git/db/reis-ad85acfe9d586b15

Caused by:
  failed to mmap. Could not write data: Invalid argument; class=Os (2)

from lan-mouse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.