[GH-ISSUE #267] Sway: output (display) rotation causes cursor to get stuck on remote #135

Open
opened 2026-05-05 22:10:56 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @ja-cop on GitHub (Feb 20, 2025).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/267

I'm connecting one system with KDE Plasma Wayland (right side) and one system with Sway (left side). The Sway system is on a laptop that can be folded into a tablet, so I have a keybinding to rotate Sway's output (in Sway, displays/screens are called "outputs").

To reproduce the issue I can do the following:

  • I start lan-mouse on both systems, then move the mouse on the KDE system to the left edge, onto the Sway system
  • Then I rotate Sway's output 90 degrees - lan-mouse still works as expected, I can move the cursor/focus back and forth
  • Then I rotate the Sway output back to the original orientation - now the mouse/keyboard focus is locked on the Sway system. There's no messages in the lan-mouse log when I move the mouse to any edge of the display
  • After restarting lan-mouse on the Sway system, it works again

Anyway, thanks for this awesome piece of software! I'm also looking forward to clipboard docs/support! I want to create a proper Guix package for this since the Sway system above runs GuixSD, but I need to get better at Guix packaging first 🙂

Originally created by @ja-cop on GitHub (Feb 20, 2025). Original GitHub issue: https://github.com/feschber/lan-mouse/issues/267 I'm connecting one system with KDE Plasma Wayland (right side) and one system with Sway (left side). The Sway system is on a laptop that can be folded into a tablet, so I have a keybinding to rotate Sway's output (in Sway, displays/screens are called "outputs"). To reproduce the issue I can do the following: * I start `lan-mouse` on both systems, then move the mouse on the KDE system to the left edge, onto the Sway system * Then I rotate Sway's output 90 degrees - `lan-mouse` still works as expected, I can move the cursor/focus back and forth * Then I rotate the Sway output back to the original orientation - now the mouse/keyboard focus is locked on the Sway system. There's no messages in the `lan-mouse` log when I move the mouse to any edge of the display * After restarting `lan-mouse` on the Sway system, it works again Anyway, thanks for this awesome piece of software! I'm also looking forward to clipboard docs/support! I want to create a proper Guix package for this since the Sway system above runs GuixSD, but I need to get better at Guix packaging first 🙂
Author
Owner

@feschber commented on GitHub (Feb 20, 2025):

what version are you on? This should be fixed very recently.

<!-- gh-comment-id:2672149558 --> @feschber commented on GitHub (Feb 20, 2025): what version are you on? This should be fixed [very recently](https://github.com/feschber/lan-mouse/issues/253).
Author
Owner

@ja-cop commented on GitHub (Feb 21, 2025):

Oh right, I was using the release from November, I should have tried git main before filing the issue. But I've now reproduced it on the latest git main:

$ lan-mouse --version
lan-mouse 0.10.0
tag:latest
commit_hash:89684e14
build_time:2025-02-21 15:05:53 +01:00
build_env:rustc 1.83.0 (90b35a623 2024-11-26),stable-x86_64-unknown-linux-gnu

Also, different from the issue you linked, lan-mouse does not crash in my case, it keeps working - moving the local mouse moves it on the remote - I just can't get back to the other screen.

<!-- gh-comment-id:2674665389 --> @ja-cop commented on GitHub (Feb 21, 2025): Oh right, I was using the release from November, I should have tried git main before filing the issue. But I've now reproduced it on the latest git main: ``` $ lan-mouse --version lan-mouse 0.10.0 tag:latest commit_hash:89684e14 build_time:2025-02-21 15:05:53 +01:00 build_env:rustc 1.83.0 (90b35a623 2024-11-26),stable-x86_64-unknown-linux-gnu ``` Also, different from the issue you linked, `lan-mouse` does not crash in my case, it keeps working - moving the local mouse moves it on the remote - I just can't get back to the other screen.
Author
Owner

@ja-cop commented on GitHub (Feb 21, 2025):

For the record, this is how I'm rotating the display output while Sway is running:

swaymsg "output eDP-1 transform 0" # output is natively portrait mode, so this sets it to portrait/tablet mode

And back again:

swaymsg "output eDP-1 transform 90" # output is natively portrait mode, so this sets it to landscape/laptop mode
<!-- gh-comment-id:2674708152 --> @ja-cop commented on GitHub (Feb 21, 2025): For the record, this is how I'm rotating the display output while Sway is running: ```sh swaymsg "output eDP-1 transform 0" # output is natively portrait mode, so this sets it to portrait/tablet mode ``` And back again: ```sh swaymsg "output eDP-1 transform 90" # output is natively portrait mode, so this sets it to landscape/laptop mode ```
Author
Owner

@feschber commented on GitHub (Feb 21, 2025):

Could you send a log from the device where the mouse can not exit?

<!-- gh-comment-id:2674730423 --> @feschber commented on GitHub (Feb 21, 2025): Could you send a log from the device where the mouse can not exit?
Author
Owner

@ja-cop commented on GitHub (Feb 21, 2025):

Here's a log:
lan-mouse.log

Every time I rotate the screen I see it printing those "active outputs: ..." messages. When it sees "eDP-1 1280x800", that's landscape mode, and "eDP-1 800x1280" is portrait mode.

At the end of the log, lan-mouse exits because I send it Ctrl+C on the terminal. Between the last screen rotation and the exit, there's no log messages, as I can't get the mouse to leave that screen (without either stopping lan-mouse or using the release keybind).

edit:

Also, for completeness, I'm using SwayFX and not vanilla Sway, but it's a fairly minimal fork and I doubt it's relevant:

$ sway --version
swayfx version 0.4 (based on sway 1.9.0)
<!-- gh-comment-id:2674870939 --> @ja-cop commented on GitHub (Feb 21, 2025): Here's a log: [lan-mouse.log](https://github.com/user-attachments/files/18910829/lan-mouse.log) Every time I rotate the screen I see it printing those "active outputs: ..." messages. When it sees "eDP-1 1280x800", that's landscape mode, and "eDP-1 800x1280" is portrait mode. At the end of the log, lan-mouse exits because I send it Ctrl+C on the terminal. Between the last screen rotation and the exit, there's no log messages, as I can't get the mouse to leave that screen (without either stopping lan-mouse or using the release keybind). edit: Also, for completeness, I'm using SwayFX and not vanilla Sway, but it's a fairly minimal fork and I doubt it's relevant: ```sh $ sway --version swayfx version 0.4 (based on sway 1.9.0) ```
Author
Owner

@feschber commented on GitHub (Feb 21, 2025):

so it does not stop working every time, am I understanding that correctly?

Also: Could you export LM_DEBUG_LAYER_SHELL=1 before starting lan-mouse? That should show you a green line of pixels, where the capture barriers are.

<!-- gh-comment-id:2675062580 --> @feschber commented on GitHub (Feb 21, 2025): so it does not stop working every time, am I understanding that correctly? Also: Could you export `LM_DEBUG_LAYER_SHELL=1` before starting lan-mouse? That should show you a green line of pixels, where the capture barriers are.
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#135
No description provided.