diff --git a/src/ShellClients/HideTracker.vala b/src/ShellClients/HideTracker.vala index efabb5ce7..59ddef20d 100644 --- a/src/ShellClients/HideTracker.vala +++ b/src/ShellClients/HideTracker.vala @@ -172,7 +172,7 @@ public class Gala.HideTracker : Object { continue; } - if (!panel.window.get_frame_rect ().overlap (window.get_frame_rect ())) { + if (!panel.get_custom_window_rect ().overlap (window.get_frame_rect ())) { continue; } diff --git a/src/Widgets/MonitorClone.vala b/src/Widgets/MonitorClone.vala index c54812773..5f6f66e7f 100644 --- a/src/Widgets/MonitorClone.vala +++ b/src/Widgets/MonitorClone.vala @@ -102,7 +102,7 @@ namespace Gala { */ public void close (bool with_gesture = false, bool is_cancel_animation = false) { window_container.restack_windows (); - window_container.close (with_gesture, is_cancel_animation); + window_container.close (with_gesture); } private void window_left (int window_monitor, Meta.Window window) { diff --git a/src/Widgets/WindowClone.vala b/src/Widgets/WindowClone.vala index db747dc10..f8f6fb80e 100644 --- a/src/Widgets/WindowClone.vala +++ b/src/Widgets/WindowClone.vala @@ -112,6 +112,7 @@ public class Gala.WindowClone : Clutter.Actor { window.notify["fullscreen"].connect (check_shadow_requirements); window.notify["maximized-horizontally"].connect (check_shadow_requirements); window.notify["maximized-vertically"].connect (check_shadow_requirements); + window.size_changed.connect (() => request_reposition ()); if (overview_mode) { var click_action = new Clutter.ClickAction (); @@ -183,16 +184,14 @@ public class Gala.WindowClone : Clutter.Actor { * at this point it will animate to it. Otherwise it will just place * itself at the location of the original window. Also adds the shadow * effect and makes sure the shadow is updated on size changes. - * - * @param was_waiting Internal argument used to indicate that we had to - * wait before the window's texture became available. */ - private void load_clone (bool was_waiting = false) { + private void load_clone () { var actor = (Meta.WindowActor) window.get_compositor_private (); if (actor == null) { Idle.add (() => { - if (window.get_compositor_private () != null) - load_clone (true); + if (window.get_compositor_private () != null) { + load_clone (); + } return Source.REMOVE; }); @@ -217,18 +216,6 @@ public class Gala.WindowClone : Clutter.Actor { if (should_fade ()) { opacity = 0; } - - // if we were waiting the view was most probably already opened when our window - // finally got available. So we fade-in and make sure we took the took place. - // If the slot is not available however, the view was probably closed while this - // window was opened, so we stay at our old place. - if (was_waiting && slot != null) { - opacity = 0; - take_slot (slot, true); - opacity = 255; - - request_reposition (); - } } private void check_shadow_requirements () { @@ -271,7 +258,7 @@ public class Gala.WindowClone : Clutter.Actor { * * @param animate Animate the transformation of the placement */ - public void transition_to_original_state (bool with_gesture = false, bool is_cancel_animation = false) { + public void transition_to_original_state (bool with_gesture = false) { var outer_rect = window.get_frame_rect (); unowned var display = window.get_display (); @@ -332,9 +319,9 @@ public class Gala.WindowClone : Clutter.Actor { * Animate the window to the given slot */ #if HAS_MUTTER45 - public void take_slot (Mtk.Rectangle rect, bool from_window_position, bool with_gesture = false, bool is_cancel_animation = false) { + public void take_slot (Mtk.Rectangle rect, bool from_window_position, bool with_gesture = false) { #else - public void take_slot (Meta.Rectangle rect, bool from_window_position, bool with_gesture = false, bool is_cancel_animation = false) { + public void take_slot (Meta.Rectangle rect, bool from_window_position, bool with_gesture = false) { #endif slot = rect; active = false; diff --git a/src/Widgets/WindowCloneContainer.vala b/src/Widgets/WindowCloneContainer.vala index d6ce80455..0e9bdea6a 100644 --- a/src/Widgets/WindowCloneContainer.vala +++ b/src/Widgets/WindowCloneContainer.vala @@ -206,7 +206,7 @@ namespace Gala { foreach (var tilable in window_positions) { unowned var clone = (WindowClone) tilable.id; - clone.take_slot (tilable.rect, opening, with_gesture, is_cancel_animation); + clone.take_slot (tilable.rect, opening && !is_cancel_animation, with_gesture); } } @@ -400,7 +400,7 @@ namespace Gala { * Calls the transition_to_original_state() function on each child * to make them take their original locations again. */ - public void close (bool with_gesture = false, bool is_cancel_animation = false) { + public void close (bool with_gesture = false) { if (!opened) { return; } @@ -408,7 +408,7 @@ namespace Gala { opened = false; foreach (var window in get_children ()) { - ((WindowClone) window).transition_to_original_state (with_gesture, is_cancel_animation); + ((WindowClone) window).transition_to_original_state (with_gesture); } } } diff --git a/src/Widgets/WorkspaceClone.vala b/src/Widgets/WorkspaceClone.vala index 0c4721ab3..e40562c30 100644 --- a/src/Widgets/WorkspaceClone.vala +++ b/src/Widgets/WorkspaceClone.vala @@ -369,8 +369,8 @@ namespace Gala { update_size (monitor); new GesturePropertyTransition (this, gesture_tracker, "x", initial_x, target_x).start (with_gesture); - new GesturePropertyTransition (background, gesture_tracker, "scale-x", 1.0d, (double) scale).start (with_gesture); - new GesturePropertyTransition (background, gesture_tracker, "scale-y", 1.0d, (double) scale).start (with_gesture); + new GesturePropertyTransition (background, gesture_tracker, "scale-x", null, (double) scale).start (with_gesture); + new GesturePropertyTransition (background, gesture_tracker, "scale-y", null, (double) scale).start (with_gesture); #if HAS_MUTTER45 Mtk.Rectangle area = { @@ -415,7 +415,7 @@ namespace Gala { new GesturePropertyTransition (background, gesture_tracker, "scale-x", null, 1.0d).start (with_gesture); new GesturePropertyTransition (background, gesture_tracker, "scale-y", null, 1.0d).start (with_gesture); - window_container.close (with_gesture, is_cancel_animation); + window_container.close (with_gesture); } } } diff --git a/src/WindowManager.vala b/src/WindowManager.vala index 37d69c639..825b11cf3 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -97,7 +97,7 @@ namespace Gala { #else private Meta.Rectangle old_rect_size_change; #endif - private Clutter.Actor latest_window_snapshot; + private Clutter.Actor? latest_window_snapshot; private GLib.Settings behavior_settings; private GLib.Settings new_behavior_settings; @@ -1402,13 +1402,13 @@ namespace Gala { latest_window_snapshot.restore_easing_state (); ulong maximize_old_handler_id = 0UL; - maximize_old_handler_id = latest_window_snapshot.transitions_completed.connect (() => { - latest_window_snapshot.disconnect (maximize_old_handler_id); - latest_window_snapshot.destroy (); + maximize_old_handler_id = latest_window_snapshot.transitions_completed.connect ((snapshot) => { + snapshot.disconnect (maximize_old_handler_id); + snapshot.destroy (); actor.set_translation (0.0f, 0.0f, 0.0f); }); - latest_window_snapshot.restore_easing_state (); + latest_window_snapshot = null; actor.set_pivot_point (0.0f, 0.0f); actor.set_translation (old_rect_size_change.x - ex, old_rect_size_change.y - ey, 0.0f); @@ -1775,11 +1775,13 @@ namespace Gala { latest_window_snapshot.restore_easing_state (); ulong unmaximize_old_handler_id = 0UL; - unmaximize_old_handler_id = latest_window_snapshot.transitions_completed.connect (() => { - latest_window_snapshot.disconnect (unmaximize_old_handler_id); - latest_window_snapshot.destroy (); + unmaximize_old_handler_id = latest_window_snapshot.transitions_completed.connect ((snapshot) => { + snapshot.disconnect (unmaximize_old_handler_id); + snapshot.destroy (); }); + latest_window_snapshot = null; + actor.set_pivot_point (0.0f, 0.0f); actor.set_position (ex, ey); actor.set_translation (-ex + offset_x * (1.0f / scale_x - 1.0f) + old_rect_size_change.x, -ey + offset_y * (1.0f / scale_y - 1.0f) + old_rect_size_change.y, 0.0f); @@ -2199,7 +2201,6 @@ namespace Gala { if (!animating_switch_workspace) { return; } - animating_switch_workspace = cancel_action; if (switch_workspace_window_created_id > 0) { disconnect (switch_workspace_window_created_id); @@ -2210,6 +2211,8 @@ namespace Gala { switch_workspace_completed (); } + animating_switch_workspace = cancel_action; + if (cancel_action) { var cancel_direction = (animation_direction == Meta.MotionDirection.LEFT) ? Meta.MotionDirection.RIGHT @@ -2291,8 +2294,7 @@ namespace Gala { } public override void kill_switch_workspace () { - // We don't care about animation direction, we don't want to cancel it, make it nudge so that it doesn't call switch_workspace_completed () - switch_workspace_animation_finished (LEFT, false, true); + end_switch_workspace (); } public override void locate_pointer () {