Skip to content
Merged
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
2 changes: 2 additions & 0 deletions lib/Gestures/ActorTarget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
switch (update_type) {
case START:
ongoing_animations++;
notify_property ("animating");
start_progress (action);
break;
case UPDATE:
Expand All @@ -94,6 +95,7 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
break;
case END:
ongoing_animations--;
notify_property ("animating");
end_progress (action);
break;
}
Expand Down
22 changes: 6 additions & 16 deletions src/Widgets/MultitaskingView/WindowClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
private Clutter.Clone? drag_handle = null;

private ulong check_confirm_dialog_cb = 0;
private bool in_slot_animation = false;

private Clutter.Actor clone_container;
private Gala.CloseButton close_button;
Expand Down Expand Up @@ -142,7 +141,7 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
};
bind_property ("monitor-scale", close_button, "monitor-scale");
close_button.triggered.connect (close_window);
close_button.notify["has-pointer"].connect (() => update_hover_widgets ());
close_button.notify["has-pointer"].connect (update_hover_widgets);

add_child (active_shape);
add_child (clone_container);
Expand All @@ -157,7 +156,8 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
window.notify["title"].connect (() => window_title.set_text (window.get_title () ?? ""));
window_title.set_text (window.get_title () ?? "");

notify["has-pointer"].connect (() => update_hover_widgets ());
notify["has-pointer"].connect (update_hover_widgets);
notify["animating"].connect (update_hover_widgets);
}

~WindowClone () {
Expand Down Expand Up @@ -272,12 +272,8 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
add_target (new PropertyTarget (MULTITASKING_VIEW, window_title, "opacity", typeof (uint), 0u, 255u));
}

public override void start_progress (GestureAction action) {
update_hover_widgets (true);
}

public override void update_progress (Gala.GestureAction action, double progress) {
if (action != CUSTOM || slot == null || !Meta.Prefs.get_gnome_animations ()) {
if (action != CUSTOM || !has_pointer || slot == null || !Meta.Prefs.get_gnome_animations ()) {
return;
}

Expand All @@ -298,8 +294,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
}

public override void end_progress (GestureAction action) {
update_hover_widgets (false);

if (action == CUSTOM && get_current_commit (CUSTOM) > 0.5 && Meta.Prefs.get_gnome_animations ()) {
close_window (Meta.CURRENT_TIME);
}
Expand Down Expand Up @@ -376,14 +370,10 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
return Clutter.EVENT_STOP;
}

private void update_hover_widgets (bool? animating = null) {
if (animating != null) {
in_slot_animation = animating;
}

private void update_hover_widgets () {
var duration = Utils.get_animation_duration (FADE_ANIMATION_DURATION);

var show = (has_pointer || close_button.has_pointer) && !in_slot_animation;
var show = (has_pointer || close_button.has_pointer) && !animating;

close_button.save_easing_state ();
close_button.set_easing_mode (Clutter.AnimationMode.LINEAR);
Expand Down