@@ -134,8 +134,9 @@ Cube.prototype = {
134
134
}
135
135
return 0 ;
136
136
} ) ;
137
- workspace_clone . chromeGroup . get_parent ( )
138
- . set_child_above_sibling ( workspace_clone . chromeGroup , null ) ;
137
+ if ( workspace_clone . chromeGroup ) {
138
+ workspace_clone . chromeGroup . get_parent ( ) . set_child_above_sibling ( workspace_clone . chromeGroup , null ) ;
139
+ }
139
140
} ,
140
141
141
142
moveWindowClone : function ( window , active_index , new_index ) {
@@ -226,34 +227,35 @@ Cube.prototype = {
226
227
clone . workspaceWindowActors . push ( windowClone ) ;
227
228
}
228
229
clone . workspaceWindows = workspaceWindows ;
229
-
230
- let chromeGroup = new St . Group ( ) ;
231
- let panels = Main . getPanels ( ) . concat ( Main . uiGroup . get_children ( ) ) ;
232
- for ( let i = 0 ; i < panels . length ; i ++ ) {
233
- if ( ! panels [ i ] ) continue ;
234
- let panel = panels [ i ] ;
235
- // Is it a non-autohideable panel, or is it a visible, tracked
236
- // chrome object?
237
- if ( ( panel . actor && ! panel . _hideable )
238
- || ( panel && Main . layoutManager . isTrackingChrome ( panel ) && panel . visible ) ) {
239
- let chromeClone = new Clutter . Clone ( {
240
- source : panel . actor ? panel . actor : panel ,
241
- x : panel . actor ? panel . actor . x : panel . x ,
242
- y : panel . actor ? panel . panelPosition === Panel . PanelLoc . bottom ?
243
- Main . layoutManager . primaryMonitor . y
244
- + Main . layoutManager . primaryMonitor . height
245
- - panel . actor . height
246
- : Main . layoutManager . primaryMonitor . y
247
- : panel . y
248
- } ) ;
249
- chromeGroup . add_child ( chromeClone ) ;
250
- chromeClone . get_parent ( ) . set_child_above_sibling ( chromeClone , null ) ;
251
- }
230
+ if ( settings . includePanels ) {
231
+ let chromeGroup = new St . Group ( ) ;
232
+ let panels = Main . getPanels ( ) . concat ( Main . uiGroup . get_children ( ) ) ;
233
+ for ( let i = 0 ; i < panels . length ; i ++ ) {
234
+ if ( ! panels [ i ] ) continue ;
235
+ let panel = panels [ i ] ;
236
+ // Is it a non-autohideable panel, or is it a visible, tracked
237
+ // chrome object?
238
+ if ( ( panel . actor && ! panel . _hideable )
239
+ || ( panel && Main . layoutManager . isTrackingChrome ( panel ) && panel . visible ) ) {
240
+ let chromeClone = new Clutter . Clone ( {
241
+ source : panel . actor ? panel . actor : panel ,
242
+ x : panel . actor ? panel . actor . x : panel . x ,
243
+ y : panel . actor ? panel . panelPosition === Panel . PanelLoc . bottom ?
244
+ Main . layoutManager . primaryMonitor . y
245
+ + Main . layoutManager . primaryMonitor . height
246
+ - panel . actor . height
247
+ : Main . layoutManager . primaryMonitor . y
248
+ : panel . y
249
+ } ) ;
250
+ chromeGroup . add_child ( chromeClone ) ;
251
+ chromeClone . get_parent ( ) . set_child_above_sibling ( chromeClone , null ) ;
252
+ }
253
+ }
254
+
255
+ clone . add_child ( chromeGroup ) ;
256
+ chromeGroup . get_parent ( ) . set_child_above_sibling ( chromeGroup , null ) ;
257
+ clone . chromeGroup = chromeGroup ;
252
258
}
253
-
254
- clone . add_child ( chromeGroup ) ;
255
- chromeGroup . get_parent ( ) . set_child_above_sibling ( chromeGroup , null ) ;
256
- clone . chromeGroup = chromeGroup ;
257
259
clone . index = workspaceIndex ;
258
260
return clone ;
259
261
} ,
@@ -304,13 +306,13 @@ Cube.prototype = {
304
306
if ( visible ) {
305
307
Tweener . addTween ( clone , {
306
308
opacity : 255 ,
307
- transition : settings . unrotateEffect ,
309
+ transition : settings . getUnrotateEffect ( ) ,
308
310
time : settings . animationTime * 0.3333 ,
309
311
} ) ;
310
312
} else {
311
313
Tweener . addTween ( clone , {
312
314
opacity : 0 ,
313
- transition : settings . rotateEffect ,
315
+ transition : settings . getRotateEffect ( ) ,
314
316
time : settings . animationTime * 0.3333 ,
315
317
} ) ;
316
318
}
@@ -341,6 +343,9 @@ Cube.prototype = {
341
343
this . actor . add_child ( from_workspace ) ;
342
344
}
343
345
346
+ // Allow Cinnamon to play the switcher sound if it's enabled.
347
+ Main . soundManager . play ( 'switch' ) ;
348
+
344
349
if ( direction === this . last_direction ) {
345
350
if ( this . from != null ) {
346
351
to_workspace = this . getWorkspaceCloneScaled ( new_workspace . index ( ) , direction ) ;
@@ -390,8 +395,10 @@ Cube.prototype = {
390
395
391
396
to . set_scale ( 1 - 2 * settings . pullaway , 1 - 2 * settings . pullaway ) ;
392
397
from . get_parent ( ) . set_child_above_sibling ( from , null ) ;
393
- if ( needScale ) this . scale ( from , to , direction ) ;
394
- else this . rotate_mid ( from , to , direction ) ;
398
+ if ( needScale )
399
+ this . scale ( from , to , direction ) ;
400
+ else
401
+ this . rotate_mid ( from , to , direction ) ;
395
402
} ,
396
403
397
404
scale : function ( from , to , direction ) {
@@ -412,7 +419,7 @@ Cube.prototype = {
412
419
scale_x : 1 - 2 * settings . pullaway ,
413
420
scale_y : 1 - 2 * settings . pullaway ,
414
421
x : x_pos ,
415
- transition : settings . scaleEffect ,
422
+ transition : settings . getScaleEffect ( ) ,
416
423
time : settings . animationTime ,
417
424
onCompleteParams : [ from , to , direction ] ,
418
425
onComplete : this . rotate_mid ,
@@ -424,6 +431,8 @@ Cube.prototype = {
424
431
this . isAnimating = true ;
425
432
this . setDesktopClonesVisible ( from , false ) ;
426
433
this . setDesktopClonesVisible ( to , false ) ;
434
+ from . show ( ) ;
435
+ to . show ( ) ;
427
436
428
437
let angle_from ;
429
438
let angle_to ;
@@ -438,14 +447,14 @@ Cube.prototype = {
438
447
Tweener . addTween ( from , {
439
448
x : global . stage . width / 2 ,
440
449
rotation_angle_y : angle_from ,
441
- transition : settings . rotateEffect ,
450
+ transition : settings . getRotateEffect ( ) ,
442
451
time : settings . animationTime ,
443
452
} ) ;
444
453
445
454
Tweener . addTween ( to , {
446
455
x : global . stage . width / 2 ,
447
456
rotation_angle_y : angle_to ,
448
- transition : settings . rotateEffect ,
457
+ transition : settings . getRotateEffect ( ) ,
449
458
time : settings . animationTime ,
450
459
onCompleteParams : [ from , to , direction ] ,
451
460
onComplete : this . rotate_end ,
@@ -455,6 +464,9 @@ Cube.prototype = {
455
464
456
465
rotate_end : function ( from , to , direction ) {
457
466
to . get_parent ( ) . set_child_above_sibling ( to , null ) ;
467
+ from . show ( ) ;
468
+ to . show ( ) ;
469
+
458
470
let x_pos ;
459
471
let angle_from ;
460
472
if ( direction === Meta . MotionDirection . LEFT ) {
@@ -468,14 +480,14 @@ Cube.prototype = {
468
480
Tweener . addTween ( from , {
469
481
x : x_pos ,
470
482
rotation_angle_y : angle_from ,
471
- transition : settings . unrotateEffect ,
483
+ transition : settings . getUnrotateEffect ( ) ,
472
484
time : settings . animationTime ,
473
485
} ) ;
474
486
475
487
Tweener . addTween ( to , {
476
488
x : x_pos ,
477
489
rotation_angle_y : 0 ,
478
- transition : settings . unrotateEffect ,
490
+ transition : settings . getUnrotateEffect ( ) ,
479
491
time : settings . animationTime ,
480
492
onComplete : this . unsetIsAnimating ,
481
493
onCompleteScope : this ,
@@ -504,7 +516,7 @@ Cube.prototype = {
504
516
scale_x : 1.0 ,
505
517
scale_y : 1.0 ,
506
518
x : x_pos ,
507
- transition : settings . unscaleEffect ,
519
+ transition : settings . getUnscaleEffect ( ) ,
508
520
time : settings . animationTime ,
509
521
onComplete : this . destroy ,
510
522
onCompleteScope : this ,
@@ -549,9 +561,9 @@ Cube.prototype = {
549
561
this . setDesktopClonesVisible ( this . from , true ) ;
550
562
this . setDesktopClonesVisible ( this . to , true ) ;
551
563
}
552
- Main . wm . showWorkspaceOSD ( ) ;
553
564
this . isAnimating = false ;
554
565
if ( this . destroy_requested ) this . onDestroy ( ) ;
566
+ Main . wm . showWorkspaceOSD ( ) ;
555
567
} ,
556
568
557
569
_keyPressEvent : function ( actor , event ) {
@@ -669,17 +681,43 @@ function CubeSettings(uuid) {
669
681
CubeSettings . prototype = {
670
682
_init : function ( uuid ) {
671
683
this . settings = new Settings . ExtensionSettings ( this , uuid ) ;
672
- this . settings . bindProperty ( Settings . BindingDirection . IN , 'animationTime' , 'animationTime' , null ) ;
684
+ this . settings . bindProperty ( Settings . BindingDirection . IN , 'animationTime' , 'animationTime' , null ) ;
673
685
this . settings . bindProperty ( Settings . BindingDirection . IN , 'pullaway' , 'pullaway' , null ) ;
674
- this . settings . bindProperty ( Settings . BindingDirection . IN , 'scaleEffect' , 'scaleEffect' , null ) ;
675
- this . settings . bindProperty ( Settings . BindingDirection . IN , 'unscaleEffect' , 'unscaleEffect' , null ) ;
676
- this . settings . bindProperty ( Settings . BindingDirection . IN , 'rotateEffect' , 'rotateEffect' , null ) ;
677
- this . settings . bindProperty ( Settings . BindingDirection . IN , 'unrotateEffect' , 'unrotateEffect' , null ) ;
686
+ this . settings . bindProperty ( Settings . BindingDirection . IN , 'newScaleEffect' , 'newScaleEffect' , null ) ;
687
+ this . settings . bindProperty ( Settings . BindingDirection . IN , 'newRotateEffect' , 'newRotateEffect' , null ) ;
688
+ this . settings . bindProperty ( Settings . BindingDirection . IN , 'includePanels' , 'includePanels' , null ) ;
689
+ } ,
690
+
691
+ getScaleEffect : function ( ) {
692
+ return "easeIn" + settings . newScaleEffect ;
693
+ } ,
694
+
695
+ getUnscaleEffect : function ( ) {
696
+ return "easeOut" + settings . newScaleEffect ;
697
+ } ,
698
+
699
+ getRotateEffect : function ( ) {
700
+ return "easeIn" + settings . newRotateEffect ;
701
+ } ,
702
+
703
+ getUnrotateEffect : function ( ) {
704
+ return "easeOut" + settings . newRotateEffect ;
678
705
}
679
706
} ;
680
707
681
708
function init ( metadata ) {
682
709
settings = new CubeSettings ( metadata . uuid ) ;
710
+
711
+ log ( `animationTime: ${ settings . animationTime } ` ) ;
712
+ log ( `pullaway: ${ settings . pullaway } ` ) ;
713
+ log ( `scaleEffect: ${ settings . newScaleEffect } ` ) ;
714
+ log ( `rotateEffect: ${ settings . newRotateEffect } ` ) ;
715
+ log ( `includePanels: ${ settings . includePanels } ` ) ;
716
+
717
+ log ( `getScaleEffect: ${ settings . getScaleEffect ( ) } ` ) ;
718
+ log ( `getUnscaleEffect: ${ settings . getUnscaleEffect ( ) } ` ) ;
719
+ log ( `getRotateEffect: ${ settings . getRotateEffect ( ) } ` ) ;
720
+ log ( `getUnrotateEffect: ${ settings . getUnrotateEffect ( ) } ` ) ;
683
721
}
684
722
685
723
function enable ( ) {
0 commit comments