@@ -97,7 +97,7 @@ namespace Gala {
9797#else
9898 private Meta . Rectangle old_rect_size_change;
9999#endif
100- private Clutter . Actor latest_window_snapshot;
100+ private Clutter . Actor ? latest_window_snapshot;
101101
102102 private GLib . Settings behavior_settings;
103103 private GLib . Settings new_behavior_settings;
@@ -1402,13 +1402,13 @@ namespace Gala {
14021402 latest_window_snapshot. restore_easing_state ();
14031403
14041404 ulong maximize_old_handler_id = 0UL ;
1405- maximize_old_handler_id = latest_window_snapshot. transitions_completed. connect (() = > {
1406- latest_window_snapshot . disconnect (maximize_old_handler_id);
1407- latest_window_snapshot . destroy ();
1405+ maximize_old_handler_id = latest_window_snapshot. transitions_completed. connect ((snapshot ) = > {
1406+ snapshot . disconnect (maximize_old_handler_id);
1407+ snapshot . destroy ();
14081408 actor. set_translation (0.0f , 0.0f , 0.0f );
14091409 });
14101410
1411- latest_window_snapshot. restore_easing_state () ;
1411+ latest_window_snapshot = null ;
14121412
14131413 actor. set_pivot_point (0.0f , 0.0f );
14141414 actor. set_translation (old_rect_size_change. x - ex, old_rect_size_change. y - ey, 0.0f );
@@ -1775,11 +1775,13 @@ namespace Gala {
17751775 latest_window_snapshot. restore_easing_state ();
17761776
17771777 ulong unmaximize_old_handler_id = 0UL ;
1778- unmaximize_old_handler_id = latest_window_snapshot. transitions_completed. connect (() = > {
1779- latest_window_snapshot . disconnect (unmaximize_old_handler_id);
1780- latest_window_snapshot . destroy ();
1778+ unmaximize_old_handler_id = latest_window_snapshot. transitions_completed. connect ((snapshot ) = > {
1779+ snapshot . disconnect (unmaximize_old_handler_id);
1780+ snapshot . destroy ();
17811781 });
17821782
1783+ latest_window_snapshot = null ;
1784+
17831785 actor. set_pivot_point (0.0f , 0.0f );
17841786 actor. set_position (ex, ey);
17851787 actor. set_translation (- ex + offset_x * (1.0f / scale_x - 1.0f ) + old_rect_size_change. x, - ey + offset_y * (1.0f / scale_y - 1.0f ) + old_rect_size_change. y, 0.0f );
@@ -2199,7 +2201,6 @@ namespace Gala {
21992201 if (! animating_switch_workspace) {
22002202 return ;
22012203 }
2202- animating_switch_workspace = cancel_action;
22032204
22042205 if (switch_workspace_window_created_id > 0 ) {
22052206 disconnect (switch_workspace_window_created_id);
@@ -2210,6 +2211,8 @@ namespace Gala {
22102211 switch_workspace_completed ();
22112212 }
22122213
2214+ animating_switch_workspace = cancel_action;
2215+
22132216 if (cancel_action) {
22142217 var cancel_direction = (animation_direction == Meta . MotionDirection . LEFT )
22152218 ? Meta . MotionDirection . RIGHT
@@ -2291,8 +2294,7 @@ namespace Gala {
22912294 }
22922295
22932296 public override void kill_switch_workspace () {
2294- // We don't care about animation direction, we don't want to cancel it, make it nudge so that it doesn't call switch_workspace_completed ()
2295- switch_workspace_animation_finished (LEFT , false , true );
2297+ end_switch_workspace ();
22962298 }
22972299
22982300 public override void locate_pointer () {
0 commit comments