Add debug for startup animation process

This commit is contained in:
Neill Whillans 2024-06-14 12:59:04 +00:00
parent a541baa00a
commit d0803d01bc
5 changed files with 41 additions and 0 deletions

View file

@ -785,10 +785,14 @@ export const LayoutManager = GObject.registerClass({
}
_startupAnimationSession() {
log(`DEBUG: _startupAnimationSession: start`);
const onStopped = () => this._startupAnimationComplete();
log(`DEBUG: _startupAnimationSession: completed`);
if (Main.sessionMode.hasOverview) {
log(`DEBUG: _startupAnimationSession: hasOverview`);
Main.overview.runStartupAnimation(onStopped);
} else {
log(`DEBUG: _startupAnimationSession: uiGroup.ease`);
this.uiGroup.ease({
scale_x: 1,
scale_y: 1,
@ -801,22 +805,30 @@ export const LayoutManager = GObject.registerClass({
}
_startupAnimationComplete() {
log(`DEBUG: _startupAnimationComplete: start`);
this._coverPane.destroy();
this._coverPane = null;
log(`DEBUG: _startupAnimationComplete: destroy coverPane`);
this._systemBackground.destroy();
this._systemBackground = null;
log(`DEBUG: _startupAnimationComplete: destroy systemBackground`);
this._startingUp = false;
this.keyboardBox.show();
log(`DEBUG: _startupAnimationComplete: show keyboardBox`);
if (!Main.sessionMode.isGreeter) {
log(`DEBUG: _startupAnimationComplete: not greeter`);
this._showSecondaryBackgrounds();
log(`DEBUG: _startupAnimationComplete: finished showSecondaryBackgrounds`);
global.window_group.remove_clip();
log(`DEBUG: _startupAnimationComplete: finished remove clip`);
}
this._queueUpdateRegions();
log(`DEBUG: _startupAnimationComplete: finished queueUpdateRegions`);
this.emit('startup-complete');
}

View file

@ -667,26 +667,31 @@ export class Overview extends Signals.EventEmitter {
}
runStartupAnimation(callback) {
log(`DEBUG: runStartupAnimation - start`);
Main.panel.style = 'transition-duration: 0ms;';
this._shown = true;
this._visible = true;
this._visibleTarget = true;
Main.layoutManager.showOverview();
log(`DEBUG: runStartupAnimation - showOverview`);
// We should call this._syncGrab() here, but moved it to happen after
// the animation because of a race in the xserver where the grab
// fails when requested very early during startup.
this._changeShownState(OverviewShownState.SHOWING);
log(`DEBUG: runStartupAnimation - changeShownState`);
this._overview.runStartupAnimation(() => {
// Overview got hidden during startup animation
if (this._shownState !== OverviewShownState.SHOWING) {
log(`DEBUG: runStartupAnimation - not shown state`);
callback();
return;
}
if (!this._syncGrab()) {
log(`DEBUG: runStartupAnimation - not syncGrab`);
callback();
this.hide();
return;
@ -694,6 +699,7 @@ export class Overview extends Signals.EventEmitter {
Main.panel.style = null;
this._changeShownState(OverviewShownState.SHOWN);
log(`DEBUG: runStartupAnimation - callback`);
callback();
});
}

View file

@ -153,6 +153,7 @@ class ControlsManagerLayout extends Clutter.LayoutManager {
}
vfunc_allocate(container, box) {
log('DEBUG: vfunc_allocate - Start');
const childBox = new Clutter.ActorBox();
const startY = this._workAreaBox.y1;
@ -194,39 +195,48 @@ class ControlsManagerLayout extends Clutter.LayoutManager {
childBox.set_size(width, thumbnailsHeight);
this._workspacesThumbnails.allocate(childBox);
}
log('DEBUG: vfunc_allocate - Workspace thumbnails');
// Workspaces
let params = [box, searchHeight, dashHeight, thumbnailsHeight, spacing];
const transitionParams = this._stateAdjustment.getStateTransitionParams();
log('DEBUG: vfunc_allocate - Workspaces');
// Update cached boxes
for (const state of Object.values(ControlsState)) {
this._cachedWorkspaceBoxes.set(
state, this._computeWorkspacesBoxForState(state, ...params));
}
log('DEBUG: vfunc_allocate - Update cached boxes');
let workspacesBox;
if (!transitionParams.transitioning) {
log('DEBUG: vfunc_allocate - Not transitioning');
workspacesBox = this._cachedWorkspaceBoxes.get(transitionParams.currentState);
} else {
log('DEBUG: vfunc_allocate - Transitioning');
const initialBox = this._cachedWorkspaceBoxes.get(transitionParams.initialState);
const finalBox = this._cachedWorkspaceBoxes.get(transitionParams.finalState);
workspacesBox = initialBox.interpolate(finalBox, transitionParams.progress);
}
this._workspacesDisplay.allocate(workspacesBox);
log('DEBUG: vfunc_allocate - Allocate workspacesDisplay');
// AppDisplay
if (this._appDisplay.visible) {
const workspaceAppGridBox =
this._cachedWorkspaceBoxes.get(ControlsState.APP_GRID);
log('DEBUG: vfunc_allocate - AppDisplay');
params = [box, searchHeight, dashHeight, workspaceAppGridBox, spacing];
let appDisplayBox;
if (!transitionParams.transitioning) {
log('DEBUG: vfunc_allocate - AppDisplay - Not Transitioning');
appDisplayBox =
this._getAppDisplayBoxForState(transitionParams.currentState, ...params);
} else {
log('DEBUG: vfunc_allocate - AppDisplay - Transitioning');
const initialBox =
this._getAppDisplayBoxForState(transitionParams.initialState, ...params);
const finalBox =
@ -237,6 +247,7 @@ class ControlsManagerLayout extends Clutter.LayoutManager {
this._appDisplay.allocate(appDisplayBox);
}
log('DEBUG: vfunc_allocate - AppDisplay completed');
// Search
childBox.set_origin(0, startY + searchHeight + spacing);
@ -244,11 +255,14 @@ class ControlsManagerLayout extends Clutter.LayoutManager {
this._searchController.allocate(childBox);
log('DEBUG: vfunc_allocate - Pre _runPostAllocation');
this._runPostAllocation();
log('DEBUG: vfunc_allocate - Post _runPostAllocation');
}
ensureAllocation() {
this.layout_changed();
log('DEBUG: overviewControls - ensureAllocation - layout_changed');
return new Promise(
resolve => this._postAllocationCallbacks.push(resolve));
}
@ -796,15 +810,18 @@ class ControlsManager extends St.Widget {
}
async runStartupAnimation(callback) {
log('DEBUG: overviewControls: runStartAnimation');
this._ignoreShowAppsButtonToggle = true;
this.prepareToEnterOverview();
log('DEBUG: overviewControls: Overview prepare');
this._stateAdjustment.value = ControlsState.HIDDEN;
this._stateAdjustment.ease(ControlsState.WINDOW_PICKER, {
duration: Overview.ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
});
log('DEBUG: overviewControls: stateAdjustment ease');
this.dash.showAppsButton.checked = false;
this._ignoreShowAppsButtonToggle = false;
@ -814,6 +831,7 @@ class ControlsManager extends St.Widget {
// We can't run the animation before the first allocation happens
await this.layout_manager.ensureAllocation();
log('DEBUG: overviewControls: allocation made');
const {STARTUP_ANIMATION_TIME} = Layout;
@ -824,6 +842,7 @@ class ControlsManager extends St.Widget {
mode: Clutter.AnimationMode.LINEAR,
});
log('DEBUG: overviewControls: opacity ease');
// Search bar falls from the ceiling
const {primaryMonitor} = Main.layoutManager;
const [, y] = this._searchEntryBin.get_transformed_position();
@ -836,6 +855,7 @@ class ControlsManager extends St.Widget {
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
});
log('DEBUG: overviewControls: searchEntryBin ease');
// The Dash rises from the bottom. This is the last animation to finish,
// so run the callback there.
this.dash.translation_y = this.dash.height + this.dash.margin_bottom;
@ -846,6 +866,7 @@ class ControlsManager extends St.Widget {
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => callback(),
});
log('DEBUG: overviewControls: dash ease');
}
get searchController() {

View file

@ -294,6 +294,7 @@ st_viewport_allocate (ClutterActor *actor,
* may not match the minimum sizes reported by the layout manager. When that
* happens, the content box needs to be adjusted to match the reported minimum
* sizes before being passed to clutter_layout_manager_allocate() */
g_print("DEBUG: clutter_layout_manager_allocate - st_viewport_allocate\n");
clutter_actor_set_allocation (actor, box);
content_box = viewport_box;

View file

@ -404,6 +404,7 @@ st_widget_allocate (ClutterActor *actor,
/* If we've chained up to here, we want to allocate the children using the
* currently installed layout manager */
g_print("DEBUG: clutter_layout_manager_allocate - st_widget_allocate\n");
clutter_layout_manager_allocate (clutter_actor_get_layout_manager (actor),
actor,
&content_box);