summaryrefslogtreecommitdiffstats
path: root/extensions/45/no-overview/extension.js
blob: 63c914a0d6795f30ffbcfd42cae928065fefc74c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
  No overview at start-up
  GNOME Shell 45+ extension
  Contributors: @fthx, @fmuellner
  License: GPL v3
*/


import * as Main from 'resource:///org/gnome/shell/ui/main.js';

export default class NoOverviewExtension {
    constructor() {
        this._realHasOverview = Main.sessionMode.hasOverview;
    }

    enable() {
        if (!Main.layoutManager._startingUp) {
            return;
        }

        Main.sessionMode.hasOverview = false;

        this._startup_complete = Main.layoutManager.connect('startup-complete', () => {
            Main.sessionMode.hasOverview = this._realHasOverview;
        });
    }

    disable() {
        Main.sessionMode.hasOverview = this._realHasOverview;
        Main.layoutManager.disconnect(this._startup_complete);
    }
}