Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions src/Widgets/MultitaskingView/WindowClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -230,22 +230,11 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
}

/**
* Animate the window to the given slot
* Sets the window slot.
*/
public void take_slot (Mtk.Rectangle rect, bool animate) {
public void take_slot (Mtk.Rectangle rect) {
slot = rect;

if (animate) {
save_easing_state ();
set_easing_duration (Utils.get_animation_duration (MultitaskingView.ANIMATION_DURATION));
set_easing_mode (EASE_OUT_QUAD);
}

update_targets ();

if (animate) {
restore_easing_state ();
}
}

private void update_targets () {
Expand Down
10 changes: 5 additions & 5 deletions src/Widgets/MultitaskingView/WindowCloneContainer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class Gala.WindowCloneContainer : ActorTarget {
if (clone == null) {
clone = new WindowClone (wm, window, monitor_scale, overview_mode);
clone.selected.connect ((_clone) => window_selected (_clone.window));
clone.request_reposition.connect (() => reflow (false));
clone.request_reposition.connect (reflow);
bind_property ("monitor-scale", clone, "monitor-scale");
}

Expand All @@ -76,7 +76,7 @@ public class Gala.WindowCloneContainer : ActorTarget {

// Don't reflow if only the sorting changed
if (to_remove.size () > 0 || added != removed) {
reflow (false);
reflow ();
}
}

Expand All @@ -97,7 +97,7 @@ public class Gala.WindowCloneContainer : ActorTarget {
}

windows.sort ();
reflow (true);
reflow ();
} else if (action == MULTITASKING_VIEW) { // If we are open we only want to restack when we close
windows.sort ();
}
Expand All @@ -121,7 +121,7 @@ public class Gala.WindowCloneContainer : ActorTarget {
/**
* Recalculate the tiling positions of the windows and animate them to the resulting spots.
*/
private void reflow (bool view_toggle) {
private void reflow () {
if (!opened || get_n_children () == 0) {
return;
}
Expand All @@ -148,7 +148,7 @@ public class Gala.WindowCloneContainer : ActorTarget {
};

foreach (var tilable in calculate_grid_placement (area, windows)) {
tilable.clone.take_slot (tilable.rect, !view_toggle);
tilable.clone.take_slot (tilable.rect);
}
}

Expand Down