[GH-ISSUE #216] disable transfer touchscreen events #100

Open
opened 2026-05-05 22:09:27 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @gh0st54rus on GitHub (Oct 14, 2024).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/216

Hello.
I use Fedora 40 KDE Wayland on host with mouse/mouse and on client laptop.
I have multiple monitors on my host, one of them is touchscreen. Before KDE 6 and lan-mouse 0.9.1 I could use the touchscreen on the host while the focus was on the client. Now the touchscreen only works when the focus is on my host.
I understand that this is due to major changes in receiving input events in KDE 6, but if it is possible to change this behavior, then it seems right not to capture input from the touchscreen at all, since this input is rigidly tied to what is displayed on the screen and does not make sense in another field.

Originally created by @gh0st54rus on GitHub (Oct 14, 2024). Original GitHub issue: https://github.com/feschber/lan-mouse/issues/216 Hello. I use Fedora 40 KDE Wayland on host with mouse/mouse and on client laptop. I have multiple monitors on my host, one of them is touchscreen. Before KDE 6 and lan-mouse 0.9.1 I could use the touchscreen on the host while the focus was on the client. Now the touchscreen only works when the focus is on my host. I understand that this is due to major changes in receiving input events in KDE 6, but if it is possible to change this behavior, then it seems right not to capture input from the touchscreen at all, since this input is rigidly tied to what is displayed on the screen and does not make sense in another field.
Author
Owner

@feschber commented on GitHub (Oct 14, 2024):

I dont have a touch-capable device myself so it would be great if you could test the following patch for me:

diff --git a/input-capture/src/libei.rs b/input-capture/src/libei.rs
index 5d7dd8d..cfdf4bd 100644
--- a/input-capture/src/libei.rs
+++ b/input-capture/src/libei.rs
@@ -169,7 +169,7 @@ async fn create_session<'a>(
     input_capture
         .create_session(
             &ashpd::WindowIdentifier::default(),
-            Capabilities::Keyboard | Capabilities::Pointer | Capabilities::Touchscreen,
+            Capabilities::Keyboard | Capabilities::Pointer,
         )
         .await
 }
@@ -540,7 +540,6 @@ static ALL_CAPABILITIES: &[DeviceCapability] = &[
     DeviceCapability::Pointer,
     DeviceCapability::PointerAbsolute,
     DeviceCapability::Keyboard,
-    DeviceCapability::Touch,
     DeviceCapability::Scroll,
     DeviceCapability::Button,
 ];

if this does what you want, I can make this a commandline option.

To apply the patch copy the diff and paste it into a file (e.g. patch) and then run

git apply path/to/the/patch

in the lan-mouse directory. (replace path/to/the/patch with the path to the file you created)

Let me know if you need help with this.

use layer-shell backend (default on KDE < 6)

Aside from that you can force the layer-shell backend, which was used in KDE 5 (and is now a fallback) by specifying

capture_backend = "LayerShell"

in ~/.config/lan-mouse/config.toml.

This should force the use of the layer-shell capture backend and restore the pre-0.9.1 behaviour.

EDIT: Please make sure you test the above patch WITHOUT this line in your config

<!-- gh-comment-id:2412095179 --> @feschber commented on GitHub (Oct 14, 2024): I dont have a touch-capable device myself so it would be great if you could test the following patch for me: ```diff diff --git a/input-capture/src/libei.rs b/input-capture/src/libei.rs index 5d7dd8d..cfdf4bd 100644 --- a/input-capture/src/libei.rs +++ b/input-capture/src/libei.rs @@ -169,7 +169,7 @@ async fn create_session<'a>( input_capture .create_session( &ashpd::WindowIdentifier::default(), - Capabilities::Keyboard | Capabilities::Pointer | Capabilities::Touchscreen, + Capabilities::Keyboard | Capabilities::Pointer, ) .await } @@ -540,7 +540,6 @@ static ALL_CAPABILITIES: &[DeviceCapability] = &[ DeviceCapability::Pointer, DeviceCapability::PointerAbsolute, DeviceCapability::Keyboard, - DeviceCapability::Touch, DeviceCapability::Scroll, DeviceCapability::Button, ]; ``` if this does what you want, I can make this a commandline option. To apply the patch copy the diff and paste it into a file (e.g. `patch`) and then run ```sh git apply path/to/the/patch ``` in the lan-mouse directory. (replace `path/to/the/patch` with the path to the file you created) Let me know if you need help with this. ## use layer-shell backend (default on KDE < 6) Aside from that you can force the `layer-shell` backend, which was used in KDE 5 (and is now a fallback) by specifying ```toml capture_backend = "LayerShell" ``` in `~/.config/lan-mouse/config.toml`. This should force the use of the layer-shell capture backend and restore the pre-0.9.1 behaviour. EDIT: Please make sure you test the above patch WITHOUT this line in your config
Author
Owner

@gh0st54rus commented on GitHub (Oct 15, 2024):

the patch doesn't work, sometimes i get the onscreen keyboard but touching the touchscreen doesn't do what i expected. use layer-shell backend seems to be what i expected, so far it works

<!-- gh-comment-id:2412850904 --> @gh0st54rus commented on GitHub (Oct 15, 2024): the patch doesn't work, sometimes i get the onscreen keyboard but touching the touchscreen doesn't do what i expected. use layer-shell backend seems to be what i expected, so far it works
Author
Owner

@feschber commented on GitHub (Oct 15, 2024):

One more thing: Could you test if this behavior is the same on GNOME?
In my eyes this is a KDE bug. (Input Capture support is very new, as you have noticed)

<!-- gh-comment-id:2414547193 --> @feschber commented on GitHub (Oct 15, 2024): One more thing: Could you test if this behavior is the same on GNOME? In my eyes this is a KDE bug. (Input Capture support is very new, as you have noticed)
Author
Owner

@gh0st54rus commented on GitHub (Oct 18, 2024):

I checked it on GNOME, you are right, it looks like a bug in KDE. In GNOME, the test version of the application with the patch works correctly: transfers mouse and keyboard input to the laptop, while touchscreen input remains on the main machine.

<!-- gh-comment-id:2422550745 --> @gh0st54rus commented on GitHub (Oct 18, 2024): I checked it on GNOME, you are right, it looks like a bug in KDE. In GNOME, the test version of the application with the patch works correctly: transfers mouse and keyboard input to the laptop, while touchscreen input remains on the main machine.
Author
Owner

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

Thank you so much for your efforts! I will report this upstream

<!-- gh-comment-id:2422562812 --> @feschber commented on GitHub (Oct 18, 2024): Thank you so much for your efforts! I will report this upstream
Author
Owner

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

https://bugs.kde.org/show_bug.cgi?id=494996

<!-- gh-comment-id:2422634843 --> @feschber commented on GitHub (Oct 18, 2024): https://bugs.kde.org/show_bug.cgi?id=494996
Author
Owner

@nbolton commented on GitHub (Oct 18, 2024):

https://bugs.kde.org/show_bug.cgi?id=494996

@sithlord48 ^

<!-- gh-comment-id:2422900972 --> @nbolton commented on GitHub (Oct 18, 2024): > https://bugs.kde.org/show_bug.cgi?id=494996 @sithlord48 ^
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#100
No description provided.