@@ -19,6 +19,7 @@ public class Gala.Zoom : Object {
1919 private ulong wins_handler_id = 0UL ;
2020
2121 private GestureTracker gesture_tracker;
22+ private GLib . Settings behavior_settings;
2223
2324 public Zoom (WindowManager wm ) {
2425 Object (wm: wm);
@@ -33,6 +34,12 @@ public class Gala.Zoom : Object {
3334 gesture_tracker. enable_touchpad ();
3435 gesture_tracker. on_gesture_detected. connect (on_gesture_detected);
3536 gesture_tracker. on_gesture_handled. connect ((gesture) = > zoom_with_gesture (gesture. direction));
37+
38+ behavior_settings = new GLib .Settings (" io.elementary.desktop.wm.behavior" );
39+
40+ var scroll_action = new SuperScrollAction (display);
41+ scroll_action. triggered. connect (handle_super_scroll);
42+ display. get_stage (). add_action_full (" zoom-super-scroll-action" , CAPTURE , scroll_action);
3643 }
3744
3845 ~Zoom () {
@@ -78,6 +85,22 @@ public class Gala.Zoom : Object {
7885 return false ;
7986 }
8087
88+ private bool handle_super_scroll (uint32 timestamp , double dx , double dy ) {
89+ if (behavior_settings. get_enum (" super-scroll-action" ) != 2 ) {
90+ return Clutter . EVENT_PROPAGATE ;
91+ }
92+
93+ var d = dx. abs () > dy. abs () ? dx : dy;
94+
95+ if (d > 0 ) {
96+ zoom (SHORTCUT_DELTA , true , AnimationsSettings . get_enable_animations ());
97+ } else if (d < 0 ) {
98+ zoom (- SHORTCUT_DELTA , true , AnimationsSettings . get_enable_animations ());
99+ }
100+
101+ return Clutter . EVENT_STOP ;
102+ }
103+
81104 private void zoom_with_gesture (GestureDirection direction ) {
82105 var initial_zoom = current_zoom;
83106 var target_zoom = (direction == GestureDirection . IN )
0 commit comments