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

View file

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

View file

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