Skip to content

Commit

Permalink
Fix shader effect after clutter 3.36 introduced paint contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
maiself committed Mar 25, 2020
1 parent 1dd570a commit 0e70aae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ const InvertWindowEffect = new Lang.Class({
Name: 'InvertWindowEffect',
Extends: Clutter.ShaderEffect,

_init: function(params) {
this.parent(params);
this.set_shader_source(' \
vfunc_get_static_shader_source: function() {
return ' \
uniform sampler2D tex; \
void main() { \
vec4 color = texture2D(tex, cogl_tex_coord_in[0].st); \
Expand All @@ -27,12 +26,12 @@ const InvertWindowEffect = new Lang.Class({
color.rgb *= color.a; \
cogl_color_out = color * cogl_color_in; \
} \
');
';
},

vfunc_paint_target: function() {
vfunc_paint_target: function(paint_context) {
this.set_uniform_value("tex", 0);
this.parent();
this.parent(paint_context);
}
});

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Inverts the color of individual windows\nDefault shortcut is Super+I",
"url": "https://github.com/maiself/gnome-shell-extension-invert-color",
"shell-version": [
"3.32"
"3.36"
],
"settings-schema": "org.gnome.shell.extensions.invert-window",
"version": 5
Expand Down

0 comments on commit 0e70aae

Please sign in to comment.