[GH-ISSUE #134] After upgrade lan mouse version to 0.8.0, Windows side can't access Linux side input #52

Closed
opened 2026-05-05 22:06:51 -06:00 by gitea-mirror · 15 comments
Owner

Originally created by @Mzyhe3n6jmFqkYQyFKzFW3kGRGMok8xTYySN4Tm on GitHub (May 18, 2024).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/134

Before upgrade to 0.8.0 everything is work perfectly, but after upgrade to 0.8.0 only Linux side can access windows side mouse input, even plug in mouse to linux pc, when access windows side mouse input can't back to linux side.

I've tried to downgrade to 0.7.3 or 0.7.2, but still not working, so i'm thinking maybe is linux upgrade something break lan mouse.

My linux system is fedora 40 KDE Plasma 6.0.4 Wayland, windows version is 26120.670.

Windows side logs:

May 18 18:23:23 fedoraremix systemd[1]: Started lan-mouse.service - Lan Mouse.
May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO  lan_mouse::config] using config: "C:\Users\username\AppData\Local\lan-mouse\config.toml"
May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO  lan_mouse] release bind: [KeyLeftCtrl, KeyLeftShift, KeyLeftMeta, KeyLeftAlt]
May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO  lan_mouse] Press Ctrl+Alt+Shift+Super to release the mouse
May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO  lan_mouse::server] running service
May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO  lan_mouse::dns] resolving 192.168.8.37 ...
May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO  lan_mouse::dns] 192.168.8.37: adding ip 192.168.8.37

Linux side logs:

May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO  lan_mouse::server] running service
May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO  lan_mouse::emulate] wayland backend not available: the requested global was not found in the registry
May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO  lan_mouse::dns] resolving 192.168.8.159 ...
May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO  lan_mouse::dns] 192.168.8.159: adding ip 192.168.8.159
May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z 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
May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO  lan_mouse::capture] using layer-shell input capture
May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO  lan_mouse::emulate::libei] requesting permission for input emulation
May 18 18:25:30 fedora lan-mouse[8244]: [2024-05-18T10:25:30Z INFO  lan_mouse::emulate] libei not available: Portal request failed: org.freedesktop.zbus.Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method 'ConnectToEIS' in interface 'org.freedesktop.impl.portal.RemoteDesktop' at object path '/org/freedesktop/portal/desktop' (signature 'osa{sv}')
May 18 18:25:30 fedora lan-mouse[8244]: [2024-05-18T10:25:30Z INFO  lan_mouse::emulate::xdg_desktop_portal] requesting permission for input emulation
May 18 18:25:30 fedora lan-mouse[8244]: [2024-05-18T10:25:30Z INFO  lan_mouse::emulate] using xdg-remote-desktop-portal input emulation
Originally created by @Mzyhe3n6jmFqkYQyFKzFW3kGRGMok8xTYySN4Tm on GitHub (May 18, 2024). Original GitHub issue: https://github.com/feschber/lan-mouse/issues/134 Before upgrade to 0.8.0 everything is work perfectly, but after upgrade to 0.8.0 only Linux side can access windows side mouse input, even plug in mouse to linux pc, when access windows side mouse input can't back to linux side. I've tried to downgrade to 0.7.3 or 0.7.2, but still not working, so i'm thinking maybe is linux upgrade something break lan mouse. My linux system is fedora 40 KDE Plasma 6.0.4 Wayland, windows version is 26120.670. Windows side logs: ``` May 18 18:23:23 fedoraremix systemd[1]: Started lan-mouse.service - Lan Mouse. May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO lan_mouse::config] using config: "C:\Users\username\AppData\Local\lan-mouse\config.toml" May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO lan_mouse] release bind: [KeyLeftCtrl, KeyLeftShift, KeyLeftMeta, KeyLeftAlt] May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO lan_mouse] Press Ctrl+Alt+Shift+Super to release the mouse May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO lan_mouse::server] running service May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO lan_mouse::dns] resolving 192.168.8.37 ... May 18 18:23:24 fedoraremix lan-mouse.exe[9877]: [2024-05-18T10:23:24Z INFO lan_mouse::dns] 192.168.8.37: adding ip 192.168.8.37 ``` Linux side logs: ``` May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO lan_mouse::server] running service May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO lan_mouse::emulate] wayland backend not available: the requested global was not found in the registry May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO lan_mouse::dns] resolving 192.168.8.159 ... May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO lan_mouse::dns] 192.168.8.159: adding ip 192.168.8.159 May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z 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 May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO lan_mouse::capture] using layer-shell input capture May 18 18:25:28 fedora lan-mouse[8244]: [2024-05-18T10:25:28Z INFO lan_mouse::emulate::libei] requesting permission for input emulation May 18 18:25:30 fedora lan-mouse[8244]: [2024-05-18T10:25:30Z INFO lan_mouse::emulate] libei not available: Portal request failed: org.freedesktop.zbus.Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method 'ConnectToEIS' in interface 'org.freedesktop.impl.portal.RemoteDesktop' at object path '/org/freedesktop/portal/desktop' (signature 'osa{sv}') May 18 18:25:30 fedora lan-mouse[8244]: [2024-05-18T10:25:30Z INFO lan_mouse::emulate::xdg_desktop_portal] requesting permission for input emulation May 18 18:25:30 fedora lan-mouse[8244]: [2024-05-18T10:25:30Z INFO lan_mouse::emulate] using xdg-remote-desktop-portal input emulation ```
Author
Owner

@feschber commented on GitHub (May 18, 2024):

Just to be sure: Did you upgrade both devices and restart the service?

<!-- gh-comment-id:2118801711 --> @feschber commented on GitHub (May 18, 2024): Just to be sure: Did you upgrade both devices and restart the service?
Author
Owner

@Mzyhe3n6jmFqkYQyFKzFW3kGRGMok8xTYySN4Tm commented on GitHub (May 18, 2024):

Yes, I did it.

<!-- gh-comment-id:2118824685 --> @Mzyhe3n6jmFqkYQyFKzFW3kGRGMok8xTYySN4Tm commented on GitHub (May 18, 2024): Yes, I did it.
Author
Owner

@Vesek commented on GitHub (May 18, 2024):

Same happening here, the Linux PC can control Windows but on Windows the mouse cannot leave the screen.

<!-- gh-comment-id:2118987967 --> @Vesek commented on GitHub (May 18, 2024): Same happening here, the Linux PC can control Windows but on Windows the mouse cannot leave the screen.
Author
Owner

@neur1n commented on GitHub (May 22, 2024):

Same here. The only version that worked for me (I just started using lan-mouse a couple of weeks ago) on two Windows 11 machines was the prerelease I downloaded on 2024-05-08, but I forgot the commit hash.

<!-- gh-comment-id:2124643421 --> @neur1n commented on GitHub (May 22, 2024): ~Same here.~ The only version that worked for me (I just started using lan-mouse a couple of weeks ago) on two Windows 11 machines was the prerelease I downloaded on 2024-05-08, but I forgot the commit hash.
Author
Owner

@feschber commented on GitHub (May 22, 2024):

Same here. The only version that worked for me (I just started using lan-mouse a couple of weeks ago) on two Windows 11 machines was the prerelease I downloaded on 2024-05-08, but I forgot the commit hash.

Thank you, that is very helpful!

<!-- gh-comment-id:2124776359 --> @feschber commented on GitHub (May 22, 2024): > Same here. The only version that worked for me (I just started using lan-mouse a couple of weeks ago) on two Windows 11 machines was the prerelease I downloaded on 2024-05-08, but I forgot the commit hash. Thank you, that is very helpful!
Author
Owner

@omgcem commented on GitHub (Jun 20, 2024):

I am also experiencing this issue with the release versions on Windows & Wayland (0.8.0).

The cursor is able to enter the windows client but not able to return to the Wayland client.

It is working with the debug version built from source on Windows (although other issues are then present on windows side) and no changes on the Wayland side.

The release version built from source experiences the same issue as the release download.

<!-- gh-comment-id:2181012709 --> @omgcem commented on GitHub (Jun 20, 2024): I am also experiencing this issue with the release versions on Windows & Wayland (0.8.0). The cursor is able to enter the windows client but not able to return to the Wayland client. It is working with the debug version built from source on Windows (although other issues are then present on windows side) and no changes on the Wayland side. The release version built from source experiences the same issue as the release download.
Author
Owner

@feschber commented on GitHub (Jun 20, 2024):

Okay this is interesting. I will hopefully get to take a look this weekend.

<!-- gh-comment-id:2181025319 --> @feschber commented on GitHub (Jun 20, 2024): Okay this is interesting. I will hopefully get to take a look this weekend.
Author
Owner

@feschber commented on GitHub (Jun 20, 2024):

Could you check if maybe the "barriers" are just on the wrong side? As in the position is set to right but it's actually on the left side?

<!-- gh-comment-id:2181027885 --> @feschber commented on GitHub (Jun 20, 2024): Could you check if maybe the "barriers" are just on the wrong side? As in the position is set to right but it's actually on the left side?
Author
Owner

@omgcem commented on GitHub (Jun 21, 2024):

I retested with the source built release version on windows (also dropped down to just 1 monitor) and was not able to exit the screen from any screen edge despite the left being configured as the barrier to the Wayland client.

Reverting back to the source built debug version allowed me to exit from the left screen edge as expected.

<!-- gh-comment-id:2182985373 --> @omgcem commented on GitHub (Jun 21, 2024): I retested with the source built release version on windows (also dropped down to just 1 monitor) and was not able to exit the screen from any screen edge despite the left being configured as the barrier to the Wayland client. Reverting back to the source built debug version allowed me to exit from the left screen edge as expected.
Author
Owner

@miroslav-suvada commented on GitHub (Jun 25, 2024):

I am experiencing a similar problem. I am running version 0.8.0 on both Windows 11 and Ubuntu 22.04.

<!-- gh-comment-id:2188042939 --> @miroslav-suvada commented on GitHub (Jun 25, 2024): I am experiencing a similar problem. I am running version 0.8.0 on both Windows 11 and Ubuntu 22.04.
Author
Owner

@feschber commented on GitHub (Jun 25, 2024):

now this is a very interesting bug. It looks to me like a compiler bug:

log::debug!("{}", wparam.0 != WM_MOUSEMOVE as usize);
log::debug!("{}, {}, {}", wparam.0, WM_MOUSEMOVE as usize, wparam.0 == WM_MOUSEMOVE as usize);

This prints

[2024-06-25T09:57:36Z DEBUG lan_mouse::capture::windows] true
[2024-06-25T09:57:36Z DEBUG lan_mouse::capture::windows] 512, 512, true
<!-- gh-comment-id:2188482893 --> @feschber commented on GitHub (Jun 25, 2024): now this is a very interesting bug. It looks to me like a compiler bug: ```rust log::debug!("{}", wparam.0 != WM_MOUSEMOVE as usize); log::debug!("{}, {}, {}", wparam.0, WM_MOUSEMOVE as usize, wparam.0 == WM_MOUSEMOVE as usize); ``` This prints ``` [2024-06-25T09:57:36Z DEBUG lan_mouse::capture::windows] true [2024-06-25T09:57:36Z DEBUG lan_mouse::capture::windows] 512, 512, true ```
Author
Owner

@feschber commented on GitHub (Jun 25, 2024):

use std::hint::black_box;
use std::ptr::addr_of;
use windows::Win32::Foundation::{LPARAM, WPARAM};
use windows::Win32::UI::WindowsAndMessaging::{MSLLHOOKSTRUCT, WM_MOUSEMOVE};

fn main() {
    let msll = MSLLHOOKSTRUCT::default();
    let wparam = WPARAM(512);
    let lparam = LPARAM(addr_of!(msll) as *const _ as isize);
    unsafe { check_client_activation(wparam, lparam) };
}

pub unsafe fn check_client_activation(wparam: WPARAM, lparam: LPARAM) -> bool {
    eprintln!("{wparam:?}, {lparam:?}");
    if wparam.0 != WM_MOUSEMOVE as usize {
        black_box(wparam.0);
        assert_ne!(wparam.0, WM_MOUSEMOVE as usize);
        return true;
    }
    let mouse_low_level: MSLLHOOKSTRUCT =
        unsafe { *std::mem::transmute::<LPARAM, *const MSLLHOOKSTRUCT>(lparam) };
    black_box(mouse_low_level.pt);

    true
}

reduced example... very very strange

<!-- gh-comment-id:2188588016 --> @feschber commented on GitHub (Jun 25, 2024): ```rust use std::hint::black_box; use std::ptr::addr_of; use windows::Win32::Foundation::{LPARAM, WPARAM}; use windows::Win32::UI::WindowsAndMessaging::{MSLLHOOKSTRUCT, WM_MOUSEMOVE}; fn main() { let msll = MSLLHOOKSTRUCT::default(); let wparam = WPARAM(512); let lparam = LPARAM(addr_of!(msll) as *const _ as isize); unsafe { check_client_activation(wparam, lparam) }; } pub unsafe fn check_client_activation(wparam: WPARAM, lparam: LPARAM) -> bool { eprintln!("{wparam:?}, {lparam:?}"); if wparam.0 != WM_MOUSEMOVE as usize { black_box(wparam.0); assert_ne!(wparam.0, WM_MOUSEMOVE as usize); return true; } let mouse_low_level: MSLLHOOKSTRUCT = unsafe { *std::mem::transmute::<LPARAM, *const MSLLHOOKSTRUCT>(lparam) }; black_box(mouse_low_level.pt); true } ``` reduced example... very very strange
Author
Owner

@feschber commented on GitHub (Jun 25, 2024):

Okay turns out, its actually UB... I should not be using transmute here

<!-- gh-comment-id:2188726357 --> @feschber commented on GitHub (Jun 25, 2024): Okay turns out, its actually UB... I should not be using transmute here
Author
Owner

@Mzyhe3n6jmFqkYQyFKzFW3kGRGMok8xTYySN4Tm commented on GitHub (Jun 25, 2024):

I have tested the dev build of lan mouse, from windows to linux is fine, but when back to windows the mouse seem to be frozen, and I can't do anything about this.

<!-- gh-comment-id:2188849515 --> @Mzyhe3n6jmFqkYQyFKzFW3kGRGMok8xTYySN4Tm commented on GitHub (Jun 25, 2024): I have tested the dev build of lan mouse, from windows to linux is fine, but when back to windows the mouse seem to be frozen, and I can't do anything about this.
Author
Owner

@feschber commented on GitHub (Jul 2, 2024):

I just squashed another bug with windows.

Please report back if anyone is still having issues now!

<!-- gh-comment-id:2203361193 --> @feschber commented on GitHub (Jul 2, 2024): I just squashed another bug with windows. Please report back if anyone is still having issues now!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/lan-mouse#52
No description provided.