Skip to content

Commit

Permalink
Reorganize extension.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasresck committed Nov 15, 2022
1 parent 6d66e06 commit bd7a688
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions extension.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 2022 vakokako
// Copyright (C) 2022 Lucas Emanuel Resck
// Copyright (C) 2022 vakokako
// Copyright (C) 2021 Taiki Sugawara

// This program is free software: you can redistribute it and/or modify
Expand All @@ -20,18 +20,7 @@ const Main = imports.ui.main;
const altTab = imports.ui.altTab;

let CurrentMonitorAppSwitcherPopup;

function init() {
CurrentMonitorAppSwitcherPopup = GObject.registerClass(
class CurrentMonitorAppSwitcherPopup extends altTab.AppSwitcherPopup {
_finish(timestamp) {
if (this._currentWindow < 0) {
extension.movePointer();
}
super._finish(timestamp);
}
});
}
let extension = null;

class Extension {
constructor() {
Expand Down Expand Up @@ -64,14 +53,23 @@ class Extension {
}
}

let extension = null;
function init() {
CurrentMonitorAppSwitcherPopup = GObject.registerClass(
class CurrentMonitorAppSwitcherPopup extends altTab.AppSwitcherPopup {
_finish(timestamp) {
if (this._currentWindow < 0) {
extension.movePointer();
}
super._finish(timestamp);
}
}
);
}

/* exported enable */
function enable() {
extension = new Extension();
}

/* exported disable */
function disable() {
extension.destroy();
extension = null;
Expand Down

0 comments on commit bd7a688

Please sign in to comment.