Skip to content

Commit 1dd570a

Browse files
committed
Update for GNOME Shell 3.32
1 parent 2932f13 commit 1dd570a

File tree

2 files changed

+4
-43
lines changed

2 files changed

+4
-43
lines changed

extension.js

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,8 @@ const ExtensionUtils = imports.misc.extensionUtils;
88
const Self = ExtensionUtils.getCurrentExtension();
99
const Convenience = Self.imports.convenience;
1010

11-
const ui = imports.ui;
12-
1311
const SHORTCUT = 'invert-window-shortcut';
1412

15-
function inject_after(proto, name, func) {
16-
let orig = proto[name];
17-
18-
proto[name] = function() {
19-
let ret = orig.apply(this, arguments);
20-
return func.apply(this, [ret].concat([].slice.call(arguments)));
21-
}
22-
23-
return orig;
24-
}
25-
26-
function remove_injection(proto, name, orig) {
27-
proto[name] = orig;
28-
}
29-
3013
const InvertWindowEffect = new Lang.Class({
3114
Name: 'InvertWindowEffect',
3215
Extends: Clutter.ShaderEffect,
@@ -55,8 +38,6 @@ const InvertWindowEffect = new Lang.Class({
5538

5639
function InvertWindow() {
5740
this.settings = Convenience.getSettings();
58-
this.workspace_injection = null;
59-
this.alttab_injection = null;
6041
}
6142

6243
InvertWindow.prototype = {
@@ -86,22 +67,6 @@ InvertWindow.prototype = {
8667
Lang.bind(this, this.toggle_effect)
8768
);
8869

89-
this.workspace_injection = inject_after(ui.workspace.WindowClone.prototype, '_init', function(ret) {
90-
if(this.realWindow.get_effect('invert-color')) {
91-
let effect = new InvertWindowEffect();
92-
this.actor.add_effect_with_name('invert-color', effect);
93-
}
94-
return ret;
95-
});
96-
97-
this.alttab_injection = inject_after(ui.altTab, '_createWindowClone', function(clone, window, size) {
98-
if(window.get_effect('invert-color')) {
99-
let effect = new InvertWindowEffect();
100-
clone.add_effect_with_name('invert-color', effect);
101-
}
102-
return clone;
103-
});
104-
10570
global.get_window_actors().forEach(function(actor) {
10671
let meta_window = actor.get_meta_window();
10772
if(meta_window.hasOwnProperty('_invert_window_tag')) {
@@ -117,12 +82,6 @@ InvertWindow.prototype = {
11782
global.get_window_actors().forEach(function(actor) {
11883
actor.remove_effect_by_name('invert-color');
11984
}, this);
120-
121-
remove_injection(ui.workspace.WindowClone.prototype, '_init', this.workspace_injection);
122-
this.workspace_injection = null;
123-
124-
remove_injection(ui.altTab, '_createWindowClone', this.alttab_injection);
125-
this.alttab_injection = null;
12685
}
12786
};
12887

metadata.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"name": "Invert Window Color",
44
"description": "Inverts the color of individual windows\nDefault shortcut is Super+I",
55
"url": "https://github.com/maiself/gnome-shell-extension-invert-color",
6-
"shell-version": ["3.16", "3.18", "3.20"],
6+
"shell-version": [
7+
"3.32"
8+
],
79
"settings-schema": "org.gnome.shell.extensions.invert-window",
8-
"version": 1
10+
"version": 5
911
}

0 commit comments

Comments
 (0)