Skip to content

Commit 74d2cf3

Browse files
committed
WindowClone: Use ActorTarget built in animating property
1 parent 91e65ff commit 74d2cf3

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

lib/Gestures/ActorTarget.vala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
8484
switch (update_type) {
8585
case START:
8686
ongoing_animations++;
87+
notify_property ("animating");
8788
start_progress (action);
8889
break;
8990
case UPDATE:
@@ -94,6 +95,7 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
9495
break;
9596
case END:
9697
ongoing_animations--;
98+
notify_property ("animating");
9799
end_progress (action);
98100
break;
99101
}

src/Widgets/MultitaskingView/WindowClone.vala

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
7272
private Clutter.Clone? drag_handle = null;
7373

7474
private ulong check_confirm_dialog_cb = 0;
75-
private bool in_slot_animation = false;
7675

7776
private Clutter.Actor clone_container;
7877
private Gala.CloseButton close_button;
@@ -142,7 +141,7 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
142141
};
143142
bind_property ("monitor-scale", close_button, "monitor-scale");
144143
close_button.triggered.connect (close_window);
145-
close_button.notify["has-pointer"].connect (() => update_hover_widgets ());
144+
close_button.notify["has-pointer"].connect (update_hover_widgets);
146145

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

160-
notify["has-pointer"].connect (() => update_hover_widgets ());
159+
notify["has-pointer"].connect (update_hover_widgets);
160+
notify["animating"].connect (update_hover_widgets);
161161
}
162162

163163
~WindowClone () {
@@ -272,10 +272,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
272272
add_target (new PropertyTarget (MULTITASKING_VIEW, window_title, "opacity", typeof (uint), 0u, 255u));
273273
}
274274

275-
public override void start_progress (GestureAction action) {
276-
update_hover_widgets (true);
277-
}
278-
279275
public override void update_progress (Gala.GestureAction action, double progress) {
280276
if (action != CUSTOM || slot == null || !Meta.Prefs.get_gnome_animations ()) {
281277
return;
@@ -298,8 +294,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
298294
}
299295

300296
public override void end_progress (GestureAction action) {
301-
update_hover_widgets (false);
302-
303297
if (action == CUSTOM && get_current_commit (CUSTOM) > 0.5 && Meta.Prefs.get_gnome_animations ()) {
304298
close_window (Meta.CURRENT_TIME);
305299
}
@@ -376,14 +370,10 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
376370
return Clutter.EVENT_STOP;
377371
}
378372

379-
private void update_hover_widgets (bool? animating = null) {
380-
if (animating != null) {
381-
in_slot_animation = animating;
382-
}
383-
373+
private void update_hover_widgets () {
384374
var duration = Utils.get_animation_duration (FADE_ANIMATION_DURATION);
385375

386-
var show = (has_pointer || close_button.has_pointer) && !in_slot_animation;
376+
var show = (has_pointer || close_button.has_pointer) && !animating;
387377

388378
close_button.save_easing_state ();
389379
close_button.set_easing_mode (Clutter.AnimationMode.LINEAR);

0 commit comments

Comments
 (0)