diff --git a/src/Widgets/MultitaskingView/WindowClone.vala b/src/Widgets/MultitaskingView/WindowClone.vala index d1607a30e..e10991e94 100644 --- a/src/Widgets/MultitaskingView/WindowClone.vala +++ b/src/Widgets/MultitaskingView/WindowClone.vala @@ -141,7 +141,6 @@ 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); add_child (active_shape); add_child (clone_container); @@ -155,9 +154,6 @@ 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["animating"].connect (update_hover_widgets); } ~WindowClone () { @@ -270,27 +266,29 @@ public class Gala.WindowClone : ActorTarget, RootTarget { add_target (new PropertyTarget (MULTITASKING_VIEW, window_icon, "opacity", typeof (uint), 0u, 255u)); add_target (new PropertyTarget (MULTITASKING_VIEW, window_title, "opacity", typeof (uint), 0u, 255u)); + + add_target (new PropertyTarget (MULTITASKING_VIEW, close_button, "opacity", typeof (uint), 0u, 255u)); } public override void update_progress (Gala.GestureAction action, double progress) { - if (action != CUSTOM || !has_pointer || slot == null || !Meta.Prefs.get_gnome_animations ()) { - return; - } - - var target_translation_y = (float) (-CLOSE_TRANSLATION * monitor_scale * progress); - var target_opacity = (uint) (255 * (1 - progress)); + if (action == CUSTOM && slot != null && Meta.Prefs.get_gnome_animations ()) { + var target_translation_y = (float) (-CLOSE_TRANSLATION * monitor_scale * progress); + var target_opacity = (uint) (255 * (1 - progress)); - clone_container.translation_y = target_translation_y; - clone_container.opacity = target_opacity; + clone_container.translation_y = target_translation_y; + clone_container.opacity = target_opacity; - window_icon.translation_y = target_translation_y; - window_icon.opacity = target_opacity; + window_icon.translation_y = target_translation_y; + window_icon.opacity = target_opacity; - window_title.translation_y = target_translation_y; - window_title.opacity = target_opacity; + window_title.translation_y = target_translation_y; + window_title.opacity = target_opacity; - close_button.translation_y = target_translation_y; - close_button.opacity = target_opacity; + close_button.translation_y = target_translation_y; + close_button.opacity = target_opacity; + } else if (action == MULTITASKING_VIEW) { + close_button.reactive = progress == 1; + } } public override void end_progress (GestureAction action) { @@ -370,18 +368,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget { return Clutter.EVENT_STOP; } - private void update_hover_widgets () { - var duration = Utils.get_animation_duration (FADE_ANIMATION_DURATION); - - var show = (has_pointer || close_button.has_pointer) && !animating; - - close_button.save_easing_state (); - close_button.set_easing_mode (Clutter.AnimationMode.LINEAR); - close_button.set_easing_duration (duration); - close_button.opacity = show ? 255 : 0; - close_button.restore_easing_state (); - } - /** * Send the window the delete signal and listen for new windows to be added * to the window's workspace, in which case we check if the new window is a @@ -620,7 +606,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget { close_button.visible = true; window_title.visible = true; - wm.get_display ().set_cursor (Meta.Cursor.DEFAULT); if (duration > 0) {