From 6abcee15d59a2c690f30e323af04b53d8049b836 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 24 Jan 2018 04:05:14 +0000 Subject: [PATCH] #1157: reverse horizontal scrolling on macos (with env var to toggle) git-svn-id: https://xpra.org/svn/Xpra/trunk@18137 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/client/ui_client_base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xpra/client/ui_client_base.py b/src/xpra/client/ui_client_base.py index 0f467a5753..107cacd2de 100644 --- a/src/xpra/client/ui_client_base.py +++ b/src/xpra/client/ui_client_base.py @@ -125,6 +125,7 @@ def add_legacy_names(codecs): TITLE_CLOSEEXIT = os.environ.get("XPRA_TITLE_CLOSEEXIT", "Xnest").split(",") SKIP_DUPLICATE_BUTTON_EVENTS = envbool("XPRA_SKIP_DUPLICATE_BUTTON_EVENTS", True) +REVERSE_HORIZONTAL_SCROLLING = envbool("XPRA_REVERSE_HORIZONTAL_SCROLLING", OSX) DRAW_TYPES = {bytes : "bytes", str : "bytes", tuple : "arrays", list : "arrays"} @@ -1254,6 +1255,8 @@ def wheel_event(self, wid, deltax=0, deltay=0, deviceid=0): #this is a different entry point for mouse wheel events, #which provides finer grained deltas (if supported by the server) #accumulate deltas: + if REVERSE_HORIZONTAL_SCROLLING: + deltax = -deltax self.wheel_deltax += deltax self.wheel_deltay += deltay button = self.wheel_map.get(6+int(self.wheel_deltax>0)) #RIGHT=7, LEFT=6 @@ -1262,7 +1265,7 @@ def wheel_event(self, wid, deltax=0, deltay=0, deviceid=0): button = self.wheel_map.get(5-int(self.wheel_deltay>0)) #UP=4, DOWN=5 if button>0: self.wheel_deltay = self.send_wheel_delta(wid, button, self.wheel_deltay, deviceid) - log("wheel_delta%s new deltas=%s,%s", (wid, deltax, deltay, deviceid), self.wheel_deltax, self.wheel_deltay) + log("wheel_event%s new deltas=%s,%s", (wid, deltax, deltay, deviceid), self.wheel_deltax, self.wheel_deltay) def send_button(self, wid, button, pressed, pointer, modifiers, buttons, *args): pressed_state = self._button_state.get(button, False)