lan-mouse icon indicating copy to clipboard operation
lan-mouse copied to clipboard

disable transfer touchscreen events

Open gh0st54rus opened this issue 1 year ago • 7 comments

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.

gh0st54rus avatar Oct 14 '24 19:10 gh0st54rus

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

feschber avatar Oct 14 '24 19:10 feschber

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

gh0st54rus avatar Oct 15 '24 04:10 gh0st54rus

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)

feschber avatar Oct 15 '24 16:10 feschber

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.

gh0st54rus avatar Oct 18 '24 14:10 gh0st54rus

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

feschber avatar Oct 18 '24 14:10 feschber

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

feschber avatar Oct 18 '24 14:10 feschber

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

@sithlord48 ^

nbolton avatar Oct 18 '24 17:10 nbolton