Skip to content

Commit

Permalink
Merge branch 'main' into leolost/fix-window-shown-multitasking-view
Browse files Browse the repository at this point in the history
  • Loading branch information
lenemter authored Dec 12, 2024
2 parents 307cece + 779ff18 commit 13bf5e3
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/ShellClients/HideTracker.vala
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/MonitorClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/Widgets/WindowClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -258,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 ();
Expand Down Expand Up @@ -319,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;
Expand Down
6 changes: 3 additions & 3 deletions src/Widgets/WindowCloneContainer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -400,15 +400,15 @@ 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;
}

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);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Widgets/WorkspaceClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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);
}
}
}
24 changes: 13 additions & 11 deletions src/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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 () {
Expand Down

0 comments on commit 13bf5e3

Please sign in to comment.