[PR #50] [MERGED] add leave event to make entering a client more reliable #251

Closed
opened 2026-05-05 22:15:14 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/feschber/lan-mouse/pull/50
Author: @feschber
Created: 12/17/2023
Status: Merged
Merged: 12/17/2023
Merged by: @feschber

Base: mainHead: leave-events


📝 Commits (1)

📊 Changes

4 files changed (+86 additions, -51 deletions)

View changed files

📝 src/backend/consumer/macos.rs (+1 -3)
📝 src/backend/producer/wayland.rs (+1 -1)
📝 src/event.rs (+24 -6)
📝 src/server.rs (+60 -41)

📄 Description

Instead of relying on release events not getting lost, every event now signals the opponent
to release its pointer grab.

There is one case that requires a Leave event:

Consider a Sending client A and receiving Client B.

If B enters the dead-zone of client A, it will send an enter event towards A but before
A receives the Release event, it may still send additional events towards B that should not cause
B to immediately revert to Receiving state again.

Therefore B puts itself into AwaitingLeave state until it receives a Leave event coming from A.
A responds to the Enter event coming from B with a leave event, to signify that it will no longer
send any events and releases it's pointer.

To guard against packet loss of the leave events, B sends additional enter events while it is in AwaitingLeave
mode until it receives a Leave event at some point.

This is still not resilient against possible packet reordering in UDP but in the (rare) case where a leave event arrives before some other event coming from A, the user would simply need to move the pointer into the dead-zone again.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/feschber/lan-mouse/pull/50 **Author:** [@feschber](https://github.com/feschber) **Created:** 12/17/2023 **Status:** ✅ Merged **Merged:** 12/17/2023 **Merged by:** [@feschber](https://github.com/feschber) **Base:** `main` ← **Head:** `leave-events` --- ### 📝 Commits (1) - [`4970193`](https://github.com/feschber/lan-mouse/commit/49701934ed9aea7b13cf7dbaee8f8edb269c6343) add leave event ### 📊 Changes **4 files changed** (+86 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `src/backend/consumer/macos.rs` (+1 -3) 📝 `src/backend/producer/wayland.rs` (+1 -1) 📝 `src/event.rs` (+24 -6) 📝 `src/server.rs` (+60 -41) </details> ### 📄 Description Instead of relying on release events not getting lost, every event now signals the opponent to release its pointer grab. There is one case that requires a Leave event: Consider a Sending client A and receiving Client B. If B enters the dead-zone of client A, it will send an enter event towards A but before A receives the Release event, it may still send additional events towards B that should not cause B to immediately revert to Receiving state again. Therefore B puts itself into `AwaitingLeave` state until it receives a Leave event coming from A. A responds to the Enter event coming from B with a leave event, to signify that it will no longer send any events and releases it's pointer. To guard against packet loss of the leave events, B sends additional enter events while it is in `AwaitingLeave` mode until it receives a Leave event at some point. This is still not resilient against possible packet reordering in UDP but in the (rare) case where a leave event arrives before some other event coming from A, the user would simply need to move the pointer into the dead-zone again. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 22:15:14 -06:00
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#251
No description provided.