@@ -53,6 +53,8 @@ namespace Gala {
53
53
}
54
54
}
55
55
56
+ private float workspaces_travel_distance;
57
+
56
58
public MultitaskingView (WindowManager wm ) {
57
59
Object (wm: wm);
58
60
}
@@ -70,11 +72,13 @@ namespace Gala {
70
72
71
73
multitasking_gesture_tracker = new GestureTracker (ANIMATION_DURATION , ANIMATION_DURATION );
72
74
multitasking_gesture_tracker. enable_touchpad ();
75
+ multitasking_gesture_tracker. enable_pan (wm, display. get_stage (), () = > InternalUtils . travel_distance_from_primary (wm. get_display (), VERTICAL ));
73
76
multitasking_gesture_tracker. on_gesture_detected. connect (on_multitasking_gesture_detected);
74
77
multitasking_gesture_tracker. on_gesture_handled. connect (() = > toggle (true , false ));
75
78
76
79
workspace_gesture_tracker = new GestureTracker (AnimationDuration . WORKSPACE_SWITCH_MIN , AnimationDuration . WORKSPACE_SWITCH );
77
80
workspace_gesture_tracker. enable_touchpad ();
81
+ workspace_gesture_tracker. enable_pan (wm, this , () = > workspaces_travel_distance);
78
82
workspace_gesture_tracker. enable_scroll (this , Clutter . Orientation . HORIZONTAL );
79
83
workspace_gesture_tracker. on_gesture_detected. connect (on_workspace_gesture_detected);
80
84
workspace_gesture_tracker. on_gesture_handled. connect ((gesture, timestamp) = > {
@@ -312,7 +316,8 @@ namespace Gala {
312
316
return false ;
313
317
}
314
318
315
- if (gesture. type == SCROLL || GestureSettings . get_action (gesture) == SWITCH_WORKSPACE ) {
319
+ if (gesture. type == SCROLL || GestureSettings . get_action (gesture) == SWITCH_WORKSPACE ||
320
+ gesture. type == TOUCHPAD_SWIPE && gesture. fingers == 1 ) {
316
321
return true ;
317
322
}
318
323
@@ -360,6 +365,8 @@ namespace Gala {
360
365
}
361
366
}
362
367
368
+ workspaces_travel_distance = (initial_x - target_x). abs ();
369
+
363
370
if (! is_nudge_animation && active_icon_group. get_transition (" backdrop-opacity" ) != null ) {
364
371
active_icon_group. remove_transition (" backdrop-opacity" );
365
372
}
@@ -689,9 +696,6 @@ namespace Gala {
689
696
}
690
697
691
698
if (opening) {
692
- modal_proxy = wm. push_modal (this );
693
- modal_proxy. set_keybinding_filter (keybinding_filter);
694
-
695
699
wm. background_group. hide ();
696
700
wm. window_group. hide ();
697
701
wm. top_window_group. hide ();
@@ -761,6 +765,13 @@ namespace Gala {
761
765
dock_clones. destroy_all_children ();
762
766
763
767
wm. pop_modal (modal_proxy);
768
+
769
+ multitasking_gesture_tracker. enable_pan (wm, wm. get_display (). get_stage (), () = > InternalUtils . travel_distance_from_primary (wm. get_display (), VERTICAL ));
770
+ } else {
771
+ modal_proxy = wm. push_modal (this );
772
+ modal_proxy. set_keybinding_filter (keybinding_filter);
773
+ // We now have to listen to events on this because it's now modal i.e. the stage doesn't get the events anymore
774
+ multitasking_gesture_tracker. enable_pan (wm, this , () = > InternalUtils . travel_distance_from_primary (wm. get_display (), VERTICAL ));
764
775
}
765
776
766
777
animating = false ;
0 commit comments