Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't control from Hyprland Server a Windows Client / Client can control Server #149

Closed
beyertom opened this issue Jun 28, 2024 · 9 comments

Comments

@beyertom
Copy link

Hi all,

i have the following issues with a Hyprland (git rev: b7f42a1e88a5b6c9d2dbdba31e0f35f6a02461e7) lan-mouse Server (most recent git) and Windows Client (Development Build from 2024-06-27).

The Hyprland Client can't control the Windows Client, i cant move the mouse "over" the magic edge.

The other way round it works. The client Mouse can control the server.

(Maybe coincidental) everything worked with an older Version of Hyprland (>= v0.40).

My config:

Server config.toml

backend = "wlroots"
frontend = "cli"
port = 4242

[left]
activate_on_startup = true
host_name = "n046524"
ips = ["10.0.3.8", "10.0.3.17"]

Client config.toml

port = 4242
frontend = "cli"

[right]
hostname = "erde"
activate_on_startup = true
ips = ["10.0.3.1", "10.0.9.1"]

[left]
hostname = "n046524"
activate_on_startup = true
ips = ["10.0.3.17"]
port = 4242

Server debug output:

[2024-06-28T08:28:35Z INFO  lan_mouse::config] using config: "/home/tom/.config/lan-mouse/config.toml"
[2024-06-28T08:28:35Z DEBUG lan_mouse::config] Some(ConfigToml { port: Some(4242), frontend: Some("cli"), release_bind: None, left: Some(TomlClient { hostname: None, host_name: Some("n046524"), ips: Some([10.0.3.8, 10.0.3.17]), port: None, activate_on_startup: Some(true), enter_hook: None }), right: None, top: None, bottom: None })
[2024-06-28T08:28:35Z DEBUG lan_mouse] Config { frontend: Cli, port: 4242, clients: [(TomlClient { hostname: None, host_name: Some("n046524"), ips: Some([10.0.3.8, 10.0.3.17]), port: None, activate_on_startup: Some(true), enter_hook: None }, Left)], daemon: false, release_bind: [KeyLeftCtrl, KeyLeftShift, KeyLeftMeta, KeyLeftAlt], test_capture: false, test_emulation: false }
[2024-06-28T08:28:35Z INFO  lan_mouse] release bind: [KeyLeftCtrl, KeyLeftShift, KeyLeftMeta, KeyLeftAlt]
[2024-06-28T08:28:35Z INFO  lan_mouse::config] using config: "/home/tom/.config/lan-mouse/config.toml"
[2024-06-28T08:28:35Z DEBUG lan_mouse::config] Some(ConfigToml { port: Some(4242), frontend: Some("cli"), release_bind: None, left: Some(TomlClient { hostname: None, host_name: Some("n046524"), ips: Some([10.0.3.8, 10.0.3.17]), port: None, activate_on_startup: Some(true), enter_hook: None }), right: None, top: None, bottom: None })
[2024-06-28T08:28:35Z DEBUG lan_mouse] Config { frontend: Cli, port: 4242, clients: [(TomlClient { hostname: None, host_name: Some("n046524"), ips: Some([10.0.3.8, 10.0.3.17]), port: None, activate_on_startup: Some(true), enter_hook: None }, Left)], daemon: true, release_bind: [KeyLeftCtrl, KeyLeftShift, KeyLeftMeta, KeyLeftAlt], test_capture: false, test_emulation: false }
[2024-06-28T08:28:35Z INFO  lan_mouse] release bind: [KeyLeftCtrl, KeyLeftShift, KeyLeftMeta, KeyLeftAlt]
[2024-06-28T08:28:35Z INFO  lan_mouse] Press Ctrl+Alt+Shift+Super to release the mouse
[2024-06-28T08:28:35Z DEBUG lan_mouse::frontend] remove socket: "/run/user/1000/lan-mouse-socket.sock"
[2024-06-28T08:28:35Z INFO  lan_mouse::server] running service
[2024-06-28T08:28:35Z INFO  lan_mouse::emulate] using wlroots input emulation
[2024-06-28T08:28:35Z INFO  lan_mouse::dns] resolving n046524 ...
[2024-06-28T08:28:35Z DEBUG lan_mouse::server::frontend_task] frontend: Activate(0, true)
[2024-06-28T08:28:35Z DEBUG lan_mouse::frontend] broadcasting event to streams: {"State":[0,{"hostname":"n046524","fix_ips":["10.0.3.17","10.0.3.8"],"port":4242,"pos":"Left","cmd":null},{"active":true,"active_addr":null,"alive":false,"ips":["10.0.3.17","10.0.3.8"],"pressed_keys":[],"resolving":true}]}
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::libei] creating input capture session
[2024-06-28T08:28:35Z INFO  lan_mouse::capture] libei input capture not available: ZBus Error: org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.InputCapture” on object at path /org/freedesktop/portal/desktop
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] ==============> requested registry
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] wl_output global
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] wl_output global
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] ==============> roundtrip 1 done
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] updating windows
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] output info: []
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] updating windows
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] output info: []
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] xdg-output - Name { name: "DP-1" }
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] xdg-output - Description { description: "LG Electronics LG HDR 4K 110NTLEET008 (DP-1)" }
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] xdg-output - LogicalPosition { x: 0, y: 0 }
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] xdg-output - LogicalSize { width: 2560, height: 1440 }
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] updating windows
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] output info: [(WlOutput { id: ObjectId(wl_output@12, 15), version: 4, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { state: (Weak) } } }, OutputInfo { name: "DP-1", position: (0, 0), size: (2560, 1440) })]
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] xdg-output - Name { name: "HDMI-A-1" }
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] xdg-output - Description { description: "HP Inc. HP E27 G4 CNK1201TRV (HDMI-A-1)" }
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] xdg-output - LogicalPosition { x: 2560, y: 0 }
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] xdg-output - LogicalSize { width: 1920, height: 1080 }
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] updating windows
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] output info: [(WlOutput { id: ObjectId(wl_output@12, 15), version: 4, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { state: (Weak) } } }, OutputInfo { name: "DP-1", position: (0, 0), size: (2560, 1440) }), (WlOutput { id: ObjectId(wl_output@15, 16), version: 4, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { state: (Weak) } } }, OutputInfo { name: "HDMI-A-1", position: (2560, 0), size: (1920, 1080) })]
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] ==============> roundtrip 2 done
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] OutputInfo {
        name: "DP-1",
        position: (
            0,
            0,
        ),
        size: (
            2560,
            1440,
        ),
    }
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] OutputInfo {
        name: "HDMI-A-1",
        position: (
            2560,
            0,
        ),
        size: (
            1920,
            1080,
        ),
    }
[2024-06-28T08:28:35Z INFO  lan_mouse::capture] using layer-shell input capture
[2024-06-28T08:28:35Z DEBUG lan_mouse::server::capture_task] input capture notify rx: Some(ClientEvent(Create(0, Left)))
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] edges: [(WlOutput { id: ObjectId(wl_output@12, 15), version: 4, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { state: (Weak) } } }, 0), (WlOutput { id: ObjectId(wl_output@15, 16), version: 4, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { state: (Weak) } } }, 2560)]
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] outputs: [(WlOutput { id: ObjectId(wl_output@12, 15), version: 4, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { state: (Weak) } } }, OutputInfo { name: "DP-1", position: (0, 0), size: (2560, 1440) })]
[2024-06-28T08:28:35Z DEBUG lan_mouse::capture::wayland] creating window output: WlOutput { id: ObjectId(wl_output@12, 15), version: 4, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { state: (Weak) } } }, size: (2560, 1440)
[2024-06-28T08:28:35Z WARN  lan_mouse::server::resolver_task] could not resolve host 'n046524': no record found for Query { name: Name("n046524."), query_type: AAAA, query_class: IN }
[2024-06-28T08:28:35Z DEBUG lan_mouse::frontend] broadcasting event to streams: {"State":[0,{"hostname":"n046524","fix_ips":["10.0.3.17","10.0.3.8"],"port":4242,"pos":"Left","cmd":null},{"active":true,"active_addr":null,"alive":false,"ips":["10.0.3.17","10.0.3.8"],"pressed_keys":[],"resolving":false}]}
[2024-06-28T08:28:35Z DEBUG lan_mouse::server::frontend_task] frontend: Enumerate
[2024-06-28T08:28:35Z DEBUG lan_mouse::frontend] broadcasting event to streams: {"Enumerate":[[0,{"hostname":"n046524","fix_ips":["10.0.3.17","10.0.3.8"],"port":4242,"pos":"Left","cmd":null},{"active":true,"active_addr":null,"alive":false,"ips":["10.0.3.17","10.0.3.8"],"pressed_keys":[],"resolving":false}]]}
lan-mouse > ^C[2024-06-28T08:33:41Z INFO  lan_mouse::server] terminating service
[2024-06-28T08:33:41Z DEBUG lan_mouse::server::capture_task] input capture notify rx: Some(Terminate)
[2024-06-28T08:33:41Z DEBUG lan_mouse::capture::wayland] destroying window!
[2024-06-28T08:33:41Z DEBUG lan_mouse::server::frontend_task] frontend: Terminate
[2024-06-28T08:33:41Z INFO  lan_mouse::server::frontend_task] terminating gracefully...
[2024-06-28T08:33:41Z DEBUG lan_mouse::frontend] remove socket: "/run/user/1000/lan-mouse-socket.sock"
[2024-06-28T08:33:41Z DEBUG lan_mouse] service exiting

Thanks for your support!

@feschber
Copy link
Owner

Could you check, if

lan-mouse --test-capture

works on Hyprland?

Hyprland has broken a lot of things removing wlroots code so maybe this is a bug introduces because of that

@beyertom
Copy link
Author

beyertom commented Jun 28, 2024

sorry, stupid question, how do i get out of the test-capture mode again?

edit: strange behavior: when i move in hyprland the mouse to the complete right edge (i have two monitors on the hyprland computer, so on the right monitor the right edge), i cant move the mouse back. Also CTRL+C is not working anymore. I need to switch TTY (ALT+CTRL+F1) and when i switch back the terminal is closed.

edit 2: why right edge? i configured in hyprland server that the Windows Computer is "left of hyprland".

@feschber
Copy link
Owner

ESC releases the mouse (this of course only works if capture works) and then you can CTRL+C in the terminal.

If your mouse is stuck, TTY switching / ssh is probably the best bet.
(should have maybe warned you, sorry about that)

2: --test-capture should configure a client on all four sides and report which side the events are coming from

@feschber
Copy link
Owner

I will checkout latest hyprland myself real quick

@feschber
Copy link
Owner

Ah wait, I've seen this before, this is a duplicate of #135 (the original issue was fixed)

@feschber
Copy link
Owner

You can use this patch:
hyprwm/Hyprland#6170 (comment)

@beyertom
Copy link
Author

awesome, thanks so much for the quick support!

@beyertom
Copy link
Author

You can use this patch: hyprwm/Hyprland#6170 (comment)

works like a charm :-) thanks again

@feschber
Copy link
Owner

No problem! Glad I could help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants