File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,29 @@ const MonitorGroup = GObject.registerClass({
218218} ) ;
219219
220220export class WorkspaceAnimationController extends GWorkspaceAnimationController {
221+ animateSwitch ( from , to , direction , onComplete ) {
222+ if ( this . _isSwipeEvent ( ) ) {
223+ switch ( direction ) {
224+ case Meta . MotionDirection . RIGHT :
225+ case Meta . MotionDirection . LEFT :
226+ return onComplete ( ) ;
227+ case Meta . MotionDirection . DOWN :
228+ case Meta . MotionDirection . UP :
229+ console . log ( "animateSwitch touch up or down" , direction ) ;
230+ super . animateSwitch ( from , to , direction , onComplete ) ;
231+ return onComplete ( ) ;
232+ }
233+ } else {
234+ switch ( direction ) {
235+ case Meta . MotionDirection . RIGHT :
236+ case Meta . MotionDirection . LEFT :
237+ case Meta . MotionDirection . DOWN :
238+ case Meta . MotionDirection . UP :
239+ super . animateSwitch ( from , to , direction , onComplete ) ;
240+ break ;
241+ }
242+ }
243+ }
221244 _prepareWorkspaceSwitch ( workspaceIndices ) {
222245 if ( this . _switchData )
223246 return ;
@@ -253,4 +276,7 @@ export class WorkspaceAnimationController extends GWorkspaceAnimationController
253276
254277 Meta . disable_unredirect_for_display ( global . display ) ;
255278 }
279+ _isSwipeEvent ( ) {
280+ return Clutter . get_current_event ( ) === null ;
281+ }
256282}
You can’t perform that action at this time.
0 commit comments