Skip to content
Snippets Groups Projects
Commit af9552d7 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Fix Autoscroll (for real this time)

Fixes #8992
parent 6207e607
No related branches found
No related tags found
No related merge requests found
...@@ -1268,9 +1268,26 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): ...@@ -1268,9 +1268,26 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
return return
else: else:
# On scrolliung UP disable autoscroll # On scrolliung UP disable autoscroll
# has_direction is on some systems always False # get_scroll_direction() sets has_direction only TRUE
# so we cant use it # if smooth scrolling is deactivated. If we have smooth
# smooth scrolling we have to use get_scroll_deltas()
has_direction, direction = event.get_scroll_direction() has_direction, direction = event.get_scroll_direction()
if not has_direction:
direction = None
smooth, delta_x, delta_y = event.get_scroll_deltas()
if smooth:
if delta_y < 0:
direction = Gdk.ScrollDirection.UP
elif delta_y > 0:
direction = Gdk.ScrollDirection.DOWN
elif delta_x < 0:
direction = Gdk.ScrollDirection.LEFT
elif delta_x > 0:
direction = Gdk.ScrollDirection.RIGHT
else:
app.log('autoscroll').warning(
'Scroll directions cant be determined')
if direction != Gdk.ScrollDirection.UP: if direction != Gdk.ScrollDirection.UP:
return return
# Check if we have a Scrollbar # Check if we have a Scrollbar
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment