mirror of
https://github.com/elementary/gala.git
synced 2024-12-26 18:53:22 +03:00
fix jumping when exiting too early
This commit is contained in:
parent
2294965136
commit
1aa57baa72
@ -27,7 +27,7 @@ namespace Gala
|
||||
*/
|
||||
public class MultitaskingView : Actor, ActivatableComponent
|
||||
{
|
||||
const int HIDING_DURATION = 300;
|
||||
public const int ANIMATION_DURATION = 250;
|
||||
const int SMOOTH_SCROLL_DELAY = 500;
|
||||
|
||||
public WindowManager wm { get; construct; }
|
||||
@ -226,11 +226,14 @@ namespace Gala
|
||||
workspace_clone.active = false;
|
||||
}
|
||||
|
||||
workspace_clone.save_easing_state ();
|
||||
workspace_clone.set_easing_duration (animate ? 200 : 0);
|
||||
workspace_clone.x = dest_x;
|
||||
workspace_clone.restore_easing_state ();
|
||||
}
|
||||
|
||||
workspaces.set_easing_duration (animate ? 300 : 0);
|
||||
workspaces.set_easing_duration (animate ?
|
||||
AnimationSettings.get_default ().workspace_switch_duration : 0);
|
||||
workspaces.x = -active_x;
|
||||
|
||||
reposition_icon_groups (animate);
|
||||
@ -473,6 +476,11 @@ namespace Gala
|
||||
if (active_workspace != null)
|
||||
workspaces.set_child_above_sibling (active_workspace, null);
|
||||
|
||||
workspaces.remove_all_transitions ();
|
||||
foreach (var child in workspaces.get_children ()) {
|
||||
child.remove_all_transitions ();
|
||||
}
|
||||
|
||||
update_positions (false);
|
||||
|
||||
foreach (var child in workspaces.get_children ()) {
|
||||
@ -484,7 +492,8 @@ namespace Gala
|
||||
}
|
||||
|
||||
if (!opening) {
|
||||
Timeout.add (290, () => {
|
||||
|
||||
Timeout.add (ANIMATION_DURATION, () => {
|
||||
foreach (var container in window_containers_monitors) {
|
||||
container.visible = false;
|
||||
}
|
||||
@ -502,7 +511,7 @@ namespace Gala
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
Timeout.add (200, () => {
|
||||
Timeout.add (ANIMATION_DURATION, () => {
|
||||
animating = false;
|
||||
return false;
|
||||
});
|
||||
|
@ -276,24 +276,17 @@ namespace Gala
|
||||
var outer_rect = window.get_outer_rect ();
|
||||
#endif
|
||||
|
||||
float offset_x = 0, offset_y = 0;
|
||||
|
||||
var parent = get_parent ();
|
||||
if (parent != null) {
|
||||
// in overview_mode the parent has just been added to the stage, so the
|
||||
// transforme position is not set yet. However, the set position is correct
|
||||
// for overview anyway, so we can just use that.
|
||||
if (overview_mode)
|
||||
parent.get_position (out offset_x, out offset_y);
|
||||
else
|
||||
parent.get_transformed_position (out offset_x, out offset_y);
|
||||
}
|
||||
var monitor_geom = window.get_screen ().get_monitor_geometry (window.get_monitor ());
|
||||
var offset_x = monitor_geom.x;
|
||||
var offset_y = monitor_geom.y;
|
||||
|
||||
save_easing_state ();
|
||||
set_easing_mode (AnimationMode.EASE_IN_OUT_CUBIC);
|
||||
set_easing_duration (animate ? 300 : 0);
|
||||
set_easing_duration (animate ? MultitaskingView.ANIMATION_DURATION : 0);
|
||||
|
||||
set_position (outer_rect.x - offset_x, outer_rect.y - offset_y);
|
||||
set_size (outer_rect.width, outer_rect.height);
|
||||
restore_easing_state ();
|
||||
|
||||
window_icon.opacity = 0;
|
||||
|
||||
@ -308,13 +301,15 @@ namespace Gala
|
||||
{
|
||||
slot = rect;
|
||||
|
||||
set_easing_duration (250);
|
||||
save_easing_state ();
|
||||
set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
||||
set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
||||
|
||||
set_size (rect.width, rect.height);
|
||||
set_position (rect.x, rect.y);
|
||||
|
||||
window_icon.opacity = 255;
|
||||
restore_easing_state ();
|
||||
|
||||
// for overview mode, windows may be faded out initially. Make sure
|
||||
// to fade those in.
|
||||
|
@ -298,7 +298,7 @@ namespace Gala
|
||||
background.set_pivot_point (0.5f, pivotY);
|
||||
|
||||
background.save_easing_state ();
|
||||
background.set_easing_duration (250);
|
||||
background.set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
||||
background.set_easing_mode (AnimationMode.EASE_OUT_QUAD);
|
||||
background.set_scale (scale, scale);
|
||||
background.restore_easing_state ();
|
||||
@ -333,7 +333,7 @@ namespace Gala
|
||||
opened = false;
|
||||
|
||||
background.save_easing_state ();
|
||||
background.set_easing_duration (300);
|
||||
background.set_easing_duration (MultitaskingView.ANIMATION_DURATION);
|
||||
background.set_easing_mode (AnimationMode.EASE_IN_OUT_CUBIC);
|
||||
background.set_scale (1, 1);
|
||||
background.restore_easing_state ();
|
||||
|
Loading…
Reference in New Issue
Block a user