Commit 3671d5a2 authored by Florian Müllner's avatar Florian Müllner Committed by Florian Müllner

cleanup: Use an extension object instead of globals

#143
parent a024d9f0
Pipeline #73917 passed with stages
in 43 seconds
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
/* exported init enable disable */
/* exported init */
const { Clutter, St } = imports.gi;
const Main = imports.ui.main;
......@@ -239,22 +239,26 @@ var MyWorkspacesView = class extends WorkspacesView.WorkspacesView {
}
};
let origWindowOverlay, origWorkspace, origWorkspacesView;
class Extension {
constructor() {
this._origWindowOverlay = Workspace.WindowOverlay;
this._origWorkspace = Workspace.Workspace;
this._origWorkspacesView = WorkspacesView.WorkspacesView;
}
function init() {
origWindowOverlay = Workspace.WindowOverlay;
origWorkspace = Workspace.Workspace;
origWorkspacesView = WorkspacesView.WorkspacesView;
}
enable() {
Workspace.WindowOverlay = MyWindowOverlay;
Workspace.Workspace = MyWorkspace;
WorkspacesView.WorkspacesView = MyWorkspacesView;
}
function enable() {
Workspace.WindowOverlay = MyWindowOverlay;
Workspace.Workspace = MyWorkspace;
WorkspacesView.WorkspacesView = MyWorkspacesView;
disable() {
Workspace.WindowOverlay = this._origWindowOverlay;
Workspace.Workspace = this._origWorkspace;
WorkspacesView.WorkspacesView = this._origWorkspacesView;
}
}
function disable() {
Workspace.WindowOverlay = origWindowOverlay;
Workspace.Workspace = origWorkspace;
WorkspacesView.WorkspacesView = origWorkspacesView;
function init() {
return new Extension();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment