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

cursor bound to single screen #83

Closed
jpeeler opened this issue Jan 26, 2024 · 7 comments · Fixed by #202
Closed

cursor bound to single screen #83

jpeeler opened this issue Jan 26, 2024 · 7 comments · Fixed by #202
Labels

Comments

@jpeeler
Copy link

jpeeler commented Jan 26, 2024

With the merge of #81, I was able to test lan-mouse for the first time between a Linux server and MacOS client. I'm using multiple screens and see that when the mouse works on the remote client screen, it is not able to continue to the adjoining screens.

I was kind of hoping that the mouse would automatically release on the edge when traversing to go back to the server. Unsure if that's because of the above issue or if you have to press the release keys by design.

(Unrelated, but there is some keyboard weirdness with the server not passing through keystrokes that are already mapped for usage in the compositor. Will report that later in another issue.)

@feschber
Copy link
Owner

feschber commented Jan 26, 2024

Yes, this is macos related. The API is a bit weird there:

// FIXME secondary displays?

Problem is that unless the absolute mouse position is restricted to screen boundaries, the relative motion gets lost in fullscreen applications. I currently restrict it to the primary screen. Need to fix that but have not yet found the time.

diff --git a/src/backend/consumer/macos.rs b/src/backend/consumer/macos.rs
index 954ec2b..3c45e13 100644
--- a/src/backend/consumer/macos.rs
+++ b/src/backend/consumer/macos.rs
@@ -135,8 +135,8 @@ impl EventConsumer for MacOSConsumer {
                         }
                     };
 
-                    mouse_location.x = (mouse_location.x + relative_x).clamp(min_x, max_x - 1.);
-                    mouse_location.y = (mouse_location.y + relative_y).clamp(min_y, max_y - 1.);
+                    mouse_location.x = (mouse_location.x + relative_x);
+                    mouse_location.y = (mouse_location.y + relative_y);
 
                     let mut event_type = CGEventType::MouseMoved;
                     if self.button_state.left {

This patch should remove this restriction but therefore breaks fullscreen apps that grab the mouse

(safe the patch to a file (e.g. patch) and run

git apply < patch

@feschber
Copy link
Owner

(Unrelated, but there is some keyboard weirdness with the server not passing through keystrokes that are already mapped for usage in the compositor. Will report that later in another issue.)

What compositor are you using on the server side?

@feschber feschber added the macos label Jan 26, 2024
@jpeeler
Copy link
Author

jpeeler commented Jan 26, 2024

That restriction removal works, but then seems to let the mouse descend off the edge display forever.

I'm using hyprland. Would you like a separate issue made?

@feschber
Copy link
Owner

A yeah, Hyprland has some issues.

  • It reports that shortcuts-inhibit is supported but its not actually implemented. This is probably what you are experiencing.
  • The pointer-constraints implementation was broken recently in conjunction with layershell (I already reported that)
  • The pointer constraints stop working when the cursor is moved on a second screen (it somehow moves even though its locked)

hyprwm/Hyprland#4465
hyprwm/Hyprland#4464

But there is nothing I can fix on my end.

@jpeeler
Copy link
Author

jpeeler commented Feb 29, 2024

Good news, shortcuts-inhibit is now implemented.

hyprwm/Hyprland#4889 is requesting for testing, specifically for 4665 but maybe 4464 is also potentially fixed?

Maybe you already saw all of this, but figured getting your input on the fix would be nice.

@feschber
Copy link
Owner

feschber commented Mar 1, 2024

Yes I have seen it but not hat the time to test until now.
Both are fixed :) And shortcuts inhibit also work. That's great news.

@Jacoby6000
Copy link
Contributor

For the macos issue where the cursor is stuck on a single monitor, I have implemented a fix: #202

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

Successfully merging a pull request may close this issue.

3 participants