SYNERGY-988 Mac client does not scroll in natural direction (#7012)
* SYNERGY-988 - Use system preferences for horizontal scrolling * Update changelog * SYNERGY-988 - Invert xscroll direction * Also revert system event xscroll * SYNERGY-988 - Update directions * SYNERGY-988 - Update changelog * SYNERGY-988 - Update scrolling direction and y scrolling * SYNERGY-988 - Update variable comment Co-authored-by: SerhiiGadzhilov <71632867+SerhiiGadzhilov@users.noreply.github.com>
This commit is contained in:
parent
c7fd0a8e4d
commit
d9b96e1988
3 changed files with 9 additions and 3 deletions
|
|
@ -3,6 +3,7 @@ v1.14.1-snapshot
|
|||
Bug fixes:
|
||||
- #7016 Fix script that generates version number
|
||||
- #7006 Resolve code scanning issues
|
||||
- #7012 Fix natural horizontal scrolling on Mac client
|
||||
|
||||
Enhancements:
|
||||
|
||||
|
|
|
|||
|
|
@ -339,6 +339,9 @@ private:
|
|||
|
||||
Thread* m_getDropTargetThread;
|
||||
String m_dropTarget;
|
||||
|
||||
// -1 for natural scrolling direction, 1 otherwise
|
||||
SInt32 m_scrollDirection = 1;
|
||||
|
||||
#if defined(MAC_OS_X_VERSION_10_7)
|
||||
Mutex* m_carbonLoopMutex;
|
||||
|
|
|
|||
|
|
@ -681,8 +681,8 @@ OSXScreen::fakeMouseWheel(SInt32 xDelta, SInt32 yDelta) const
|
|||
CGEventRef scrollEvent = CGEventCreateScrollWheelEvent(
|
||||
NULL, kCGScrollEventUnitLine, 2,
|
||||
mapScrollWheelFromSynergy(yDelta),
|
||||
-mapScrollWheelFromSynergy(xDelta));
|
||||
|
||||
mapScrollWheelFromSynergy(xDelta));
|
||||
|
||||
// Fix for sticky keys
|
||||
CGEventFlags modifiers = m_keyState->getModifierStateAsOSXFlags();
|
||||
CGEventSetFlags(scrollEvent, modifiers);
|
||||
|
|
@ -840,6 +840,8 @@ OSXScreen::enter()
|
|||
setZeroSuppressionInterval();
|
||||
}
|
||||
else {
|
||||
m_scrollDirection = [[[NSUserDefaults standardUserDefaults] objectForKey:@"com.apple.swipescrolldirection"] boolValue] ? -1 : 1;
|
||||
|
||||
// reset buttons
|
||||
m_buttonState.reset();
|
||||
|
||||
|
|
@ -1448,7 +1450,7 @@ OSXScreen::mapScrollWheelFromSynergy(SInt32 x) const
|
|||
{
|
||||
// use server's acceleration with a little boost since other platforms
|
||||
// take one wheel step as a larger step than the mac does.
|
||||
return static_cast<SInt32>(3.0 * x / 120.0);
|
||||
return static_cast<SInt32>(m_scrollDirection * 3.0 * x / 120.0);
|
||||
}
|
||||
|
||||
double
|
||||
|
|
|
|||
Loading…
Reference in a new issue