-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
MacOS Multimonitor support #202
MacOS Multimonitor support #202
Conversation
Regardless of the above comment: It does look like a good fix to me and the optimization mentioned could be made in a separate PR. Unfortunately I have no way of testing multiple displays on MacOS, so I will have to trust you on this ;) (maybe @jpeeler can confirm?) |
@nbolton No, this is only about being able to move the cursor onto different screens when controlled remotely. I was lazy there and clamped it to the boundaries of the primary display instead of any display. The "activation" barrier is a big rectangle as well (as of right now): |
Assuming you're talking about the issue with synergy where your mouse would get stuck off screen up until it hit the coordinates of the largest x/y bound of the given side: this solution does not have that issue. It uses the bounds of the display that the mouse is currently on to avoid that issue. When the mouse goes off screen, it checks if it would be on a new monitor. If it would, it does not clamp the position. Otherwise it clamps to the current display bounds. |
I think your above comment about the optimization got lost, but I think I have one in mind. I can make a single call to get every display that the mouse might be on by checking with a rect of size dx, dy. From there I can also do smarter clamping by pulling the mouse back in to the nearest edge rather than simply camping. However by the time I'm done doing all that I'm not sure it would perform better than the current solution 🤔 I'm not sure what the overhead of calling |
Ah yes, you're right. There is two problems to solve here, really:
|
This is exactly the problem, I have with the solution. We dont know how expensive this call really is. Therefore, I'd prefer to only call this function whenever we need to (= when some display is connected / rearranged). I would merge this now, if you're fine with that and we can do these things in a separate PR |
[Off-topic] Looking forward to seeing how you solve that one. I haven't attempted it yet. |
Sounds good to me. I'll look in to putting in the more optimized fix in the coming days. |
Thanks again for the contribution! |
It is going to be hard for me to test this without a Mac so might take a while ... In Linux it all works very differently but I tried to implement this in Windows before. |
It's been a while since I last tested, so I don't have a good comparison point. But with latest code it seems to work as expected with multi-monitors on MacOS. I know this is the not the right place to have this conversation, but would a request for supporting smithay based compositors be considered? (I've migrated from hyprland to niri.) |
thanks for confirming!
This is really more of a smithay supporting lan-mouse kind of thing instead of lan-mouse supporting smithay. You would need either libei support through input-capture portal or support for the wlr-virtual keyboard / pointer protocols |
I'm pretty new to rust, so don't be afraid to tell me anything I did horribly wrong 😅
This seems to fix multi-monitors on macos and hasn't had any issues from what I can tell.
The basic process is:
Resolves #83