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

disable transfer touchscreen events #216

Open
gh0st54rus opened this issue Oct 14, 2024 · 7 comments
Open

disable transfer touchscreen events #216

gh0st54rus opened this issue Oct 14, 2024 · 7 comments

Comments

@gh0st54rus
Copy link

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.

@feschber
Copy link
Owner

feschber commented 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

@gh0st54rus
Copy link
Author

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

@feschber
Copy link
Owner

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)

@gh0st54rus
Copy link
Author

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.

@feschber
Copy link
Owner

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

@feschber
Copy link
Owner

@nbolton
Copy link
Contributor

nbolton commented Oct 18, 2024

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

3 participants