@@ -8,25 +8,8 @@ const ExtensionUtils = imports.misc.extensionUtils;
8
8
const Self = ExtensionUtils . getCurrentExtension ( ) ;
9
9
const Convenience = Self . imports . convenience ;
10
10
11
- const ui = imports . ui ;
12
-
13
11
const SHORTCUT = 'invert-window-shortcut' ;
14
12
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
-
30
13
const InvertWindowEffect = new Lang . Class ( {
31
14
Name : 'InvertWindowEffect' ,
32
15
Extends : Clutter . ShaderEffect ,
@@ -55,8 +38,6 @@ const InvertWindowEffect = new Lang.Class({
55
38
56
39
function InvertWindow ( ) {
57
40
this . settings = Convenience . getSettings ( ) ;
58
- this . workspace_injection = null ;
59
- this . alttab_injection = null ;
60
41
}
61
42
62
43
InvertWindow . prototype = {
@@ -86,22 +67,6 @@ InvertWindow.prototype = {
86
67
Lang . bind ( this , this . toggle_effect )
87
68
) ;
88
69
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
-
105
70
global . get_window_actors ( ) . forEach ( function ( actor ) {
106
71
let meta_window = actor . get_meta_window ( ) ;
107
72
if ( meta_window . hasOwnProperty ( '_invert_window_tag' ) ) {
@@ -117,12 +82,6 @@ InvertWindow.prototype = {
117
82
global . get_window_actors ( ) . forEach ( function ( actor ) {
118
83
actor . remove_effect_by_name ( 'invert-color' ) ;
119
84
} , 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 ;
126
85
}
127
86
} ;
128
87
0 commit comments