MCPcopy Index your code
hub / github.com/material-shell/material-shell / enable

Method enable

src/extension.ts:104–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102 layout?: MsMain;
103
104 override enable(): void {
105 log('----------------');
106 log('ENABLE EXTENSION');
107 log('----------------');
108 global.ms = this;
109
110 if (this.locked) {
111 this.locked = false;
112 this.layout?.panel.enable();
113 oldOverview.isDummy = true;
114
115 return;
116 }
117 polyfillClutter();
118 new Debug();
119 _closingId = global.display.connect('closing', () => {
120 this.closing = true;
121 });
122 this.monitorsLength = Main.layoutManager.monitors.length;
123 // Show a splashscreen while we are updating the UI layout and theme
124 if (Main.layoutManager._startingUp) {
125 this.showSplashScreens();
126 }
127 this.loaded = false;
128 this.stateManager = new StateManager();
129
130 GLib.idle_add(GLib.PRIORITY_LOW, () => {
131 //Then disable incompatibles extensions;
132 disableIncompatibleExtensionsModule =
133 new DisableIncompatibleExtensionsModule();
134
135 //Load persistent data
136 this.stateManager?.loadRegistry((state) => {
137 modules = [new RequiredSettingsModule(), new OverrideModule()];
138 this.tooltipManager = new TooltipManager();
139 this.layoutManager = new LayoutManager();
140 this.msWindowManager = new MsWindowManager();
141 this.msWorkspaceManager = new MsWorkspaceManager(
142 state['workspaces-state']
143 );
144 this.msNotificationManager = new MsNotificationManager();
145 modules = [
146 ...modules,
147 (this.hotKeysModule = new HotKeysModule()),
148 ];
149 this.msThemeManager = new MsThemeManager();
150 this.msThemeManager.regenerateStylesheet();
151 if (getSettings('tweaks').get_boolean('enable-persistence')) {
152 this.msWorkspaceManager.restorePreviousState();
153 } else {
154 this.msWorkspaceManager.initState();
155 }
156 this.layout = new MsMain();
157 this.msWindowManager.handleExistingMetaWindows();
158 if (Main.layoutManager._startingUp) {
159 _startupPreparedId = Main.layoutManager.connect(
160 'startup-complete',
161 () => this.load(true)

Callers

nothing calls this directly

Calls 13

showSplashScreensMethod · 0.95
loadMethod · 0.95
polyfillClutterFunction · 0.90
getSettingsFunction · 0.90
logFunction · 0.85
loadRegistryMethod · 0.80
regenerateStylesheetMethod · 0.80
restorePreviousStateMethod · 0.80
initStateMethod · 0.80
enableMethod · 0.65
connectMethod · 0.65

Tested by

no test coverage detected