mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-09 13:15:33 +08:00
5e35fe2c1bff01e0fd5bd8acaba442ba80c97cd7
As reported in #451, with the Mac server, sleeping and resuming (on the
server) causes the mouse speed to double on the client upon resume.
Fix by removing the CFRunLoopSource from the run loop on screen disable
before releasing it. CFRunLoopAddSource in enable() retains the
CFRunLoopSource, so even though the source is released in disable(), the
run loop still has a copy. When the server comes out of sleep and the
screen is enable()'d, another event tap and run loop source are created
and added to the run loop, so the callback is now being called twice for
every mouse movement, and so on for every additional time the server
sleeps.
This is a better approach than the fix in 267f3ac41f, because although
that fixes the issue by disabling the event tap before the event tap and
run loop source are released, a memory leak still occurs since they are
retained by the run loop.
Additional references on the behavior of CFRunLoopAddSource:
https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFRunLoopRef/index.html#//apple_ref/c/func/CFRunLoopAddSource
http://www.cocoabuilder.com/archive/cocoa/242438-trouble-with-event-taps.html
Synergy ======= Share one mouse and keyboard between multiple computers. Synergy is free and open source (free as in free speech), meaning you are free to run it and redistribute it with or without changes. Just use "hm conf" and "hm build" to compile (./hm.sh on Linux and Mac). For detailed compile instructions: http://synergy-project.org/wiki/Compiling Happy hacking!
Languages
C++
50.3%
C
47.5%
Objective-C++
1.1%
CMake
0.8%
Objective-C
0.1%