Skip to content

Commit

Permalink
docking: Use the signal handler to disconnect on startup-completed si…
Browse files Browse the repository at this point in the history
…gnal

As requested by the g.e.o review, it's not really a big deal though
since this signal is going to really last few frames and the extension
is not really unloaded by that time.
  • Loading branch information
3v1n0 authored and vanvugt committed Apr 19, 2024
1 parent 35e2b31 commit 4aad71e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const Labels = Object.freeze({
MAIN_DASH: Symbol('main-dash'),
OLD_DASH_CHANGES: Symbol('old-dash-changes'),
SETTINGS: Symbol('settings'),
STARTUP_ANIMATION: Symbol('startup-animation'),
WORKSPACE_SWITCH_SCROLL: Symbol('workspace-switch-scroll'),
});

Expand Down Expand Up @@ -467,7 +468,6 @@ const DockedDash = GObject.registerClass({
if (Main.overview.visibleTarget)
this._onOverviewShowing();


this._updateAutoHideBarriers();
}

Expand Down Expand Up @@ -2421,11 +2421,12 @@ export class DockManager {
if (this._settings.disableOverviewOnStartup)
Main.sessionMode.hasOverview = false;

const id = Main.layoutManager.connect('startup-complete', () => {
Main.sessionMode.hasOverview = hadOverview;
Main.layoutManager.disconnect(id);
this._runStartupAnimation();
});
this._signalsHandler.addWithLabel(Labels.STARTUP_ANIMATION,
Main.layoutManager, 'startup-complete', () => {
this._signalsHandler.removeWithLabel(Labels.STARTUP_ANIMATION);
Main.sessionMode.hasOverview = hadOverview;
this._runStartupAnimation();
});
}
}

Expand Down

0 comments on commit 4aad71e

Please sign in to comment.