Commit a54c9b6f authored by Jens Georg's avatar Jens Georg

Wayland: Fix scroll and zoom

Scroll and zoom with mouse wheel did not work anymore on Wayland

https://bugzilla.gnome.org/show_bug.cgi?id=781472
parent 6d6e3302
......@@ -174,7 +174,7 @@ public abstract class Page : Gtk.ScrolledWindow {
event_source.add_events(Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK
| Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.POINTER_MOTION_HINT_MASK
| Gdk.EventMask.BUTTON_MOTION_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK
| Gdk.EventMask.SCROLL_MASK);
| Gdk.EventMask.SCROLL_MASK | Gdk.EventMask.SMOOTH_SCROLL_MASK);
event_source.button_press_event.connect(on_button_pressed_internal);
event_source.button_release_event.connect(on_button_released_internal);
event_source.motion_notify_event.connect(on_motion_internal);
......@@ -1026,6 +1026,23 @@ public abstract class Page : Gtk.ScrolledWindow {
case Gdk.ScrollDirection.RIGHT:
return on_mousewheel_right(event);
case Gdk.ScrollDirection.SMOOTH:
{
double dx, dy;
event.get_scroll_deltas(out dx, out dy);
if (dy < 0)
return on_mousewheel_up(event);
else if (dy > 0)
return on_mousewheel_down(event);
else if (dx < 0)
return on_mousewheel_left(event);
else if (dx > 0)
return on_mousewheel_right(event);
else
return false;
}
default:
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment