Fix multitasking view allocation assertions (#1463)

This commit is contained in:
David Hewitt 2022-09-26 22:07:24 +01:00 committed by GitHub
parent 40bd02c621
commit 23c7edeb0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -674,9 +674,6 @@ namespace Gala {
} }
void show_docks (bool with_gesture, bool is_cancel_animation) { void show_docks (bool with_gesture, bool is_cancel_animation) {
float clone_offset_x, clone_offset_y;
dock_clones.get_transformed_position (out clone_offset_x, out clone_offset_y);
unowned GLib.List<Meta.WindowActor> window_actors = display.get_window_actors (); unowned GLib.List<Meta.WindowActor> window_actors = display.get_window_actors ();
foreach (unowned Meta.WindowActor actor in window_actors) { foreach (unowned Meta.WindowActor actor in window_actors) {
const int MAX_OFFSET = 85; const int MAX_OFFSET = 85;
@ -702,11 +699,11 @@ namespace Gala {
if (!top && !bottom) if (!top && !bottom)
continue; continue;
var initial_x = actor.x - clone_offset_x; var initial_x = actor.x;
var initial_y = actor.y - clone_offset_y; var initial_y = actor.y;
var target_y = (top) var target_y = (top)
? actor.y - actor.height - clone_offset_y ? actor.y - actor.height
: actor.y + actor.height - clone_offset_y; : actor.y + actor.height;
var clone = new SafeWindowClone (window, true); var clone = new SafeWindowClone (window, true);
dock_clones.add_child (clone); dock_clones.add_child (clone);
@ -742,13 +739,10 @@ namespace Gala {
} }
void hide_docks (bool with_gesture, bool is_cancel_animation) { void hide_docks (bool with_gesture, bool is_cancel_animation) {
float clone_offset_x, clone_offset_y;
dock_clones.get_transformed_position (out clone_offset_x, out clone_offset_y);
foreach (var child in dock_clones.get_children ()) { foreach (var child in dock_clones.get_children ()) {
var dock = (Clone) child; var dock = (Clone) child;
var initial_y = dock.y; var initial_y = dock.y;
var target_y = dock.source.y - clone_offset_y; var target_y = dock.source.y;
GestureTracker.OnUpdate on_animation_update = (percentage) => { GestureTracker.OnUpdate on_animation_update = (percentage) => {
var y = GestureTracker.animation_value (initial_y, target_y, percentage); var y = GestureTracker.animation_value (initial_y, target_y, percentage);