Skip to content

Commit

Permalink
Drop unused and duplicate attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarthayhurst committed Feb 13, 2024
1 parent 134e02c commit 6cc5f85
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,6 @@ class Caffeine extends QuickSettings.SystemIndicator {
this._appAddWindowSignalId = 0;
this._appRemoveWindowSignalId = 0;

this._screen = global.display;
this._display = this._screen;

// Add indicator label for the timer
this._timerLabel = new St.Label({
y_expand: true,
Expand Down Expand Up @@ -323,7 +320,7 @@ class Caffeine extends QuickSettings.SystemIndicator {

// Enable caffeine when fullscreen app is running
if (this._settings.get_boolean(FULLSCREEN_KEY)) {
this._inFullscreenId = this._screen.connect('in-fullscreen-changed', this.toggleFullscreen.bind(this));
this._inFullscreenId = global.display.connect('in-fullscreen-changed', this.toggleFullscreen.bind(this));
this.toggleFullscreen();
}

Expand Down Expand Up @@ -384,10 +381,10 @@ class Caffeine extends QuickSettings.SystemIndicator {
}

get inFullscreen() {
let nbMonitors = this._screen.get_n_monitors();
let nbMonitors = global.display.get_n_monitors();
let inFullscreen = false;
for (let i = 0; i < nbMonitors; i++) {
if (this._screen.get_monitor_in_fullscreen(i)) {
if (global.display.get_monitor_in_fullscreen(i)) {
inFullscreen = true;
break;
}
Expand Down Expand Up @@ -1019,7 +1016,7 @@ class Caffeine extends QuickSettings.SystemIndicator {

// Disconnect from signals
if (this._settings.get_boolean(FULLSCREEN_KEY)) {
this._screen.disconnect(this._inFullscreenId);
global.display.disconnect(this._inFullscreenId);
}
if (this._inhibitorAddedId) {
this._sessionManager.disconnectSignal(this._inhibitorAddedId);
Expand All @@ -1029,10 +1026,6 @@ class Caffeine extends QuickSettings.SystemIndicator {
this._sessionManager.disconnectSignal(this._inhibitorRemovedId);
this._inhibitorRemovedId = 0;
}
if (this._windowCreatedId) {
this._display.disconnect(this._windowCreatedId);
this._windowCreatedId = 0;
}
if (this._windowDestroyedId) {
global.window_manager.disconnect(this._windowDestroyedId);
this._windowDestroyedId = 0;
Expand Down

0 comments on commit 6cc5f85

Please sign in to comment.