WindowDimmer: Don't try to use a ShaderEffect when GLSL is not available
This obviously won't work anyway but will just spam stderr with warnings, so don't do it.
This commit is contained in:
parent
4eec7413c7
commit
130f2cf808
@ -37,14 +37,23 @@ function WindowDimmer(actor) {
|
|||||||
|
|
||||||
WindowDimmer.prototype = {
|
WindowDimmer.prototype = {
|
||||||
_init: function(actor) {
|
_init: function(actor) {
|
||||||
this.effect = new Clutter.ShaderEffect({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER });
|
if (Clutter.feature_available(Clutter.FeatureFlags.SHADERS_GLSL)) {
|
||||||
this.effect.set_shader_source(getDimShaderSource());
|
this.effect = new Clutter.ShaderEffect({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER });
|
||||||
|
this.effect.set_shader_source(getDimShaderSource());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this._effect = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.actor = actor;
|
this.actor = actor;
|
||||||
},
|
},
|
||||||
|
|
||||||
set dimFraction(fraction) {
|
set dimFraction(fraction) {
|
||||||
this._dimFraction = fraction;
|
this._dimFraction = fraction;
|
||||||
|
|
||||||
|
if (this.effect == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!Meta.prefs_get_attach_modal_dialogs()) {
|
if (!Meta.prefs_get_attach_modal_dialogs()) {
|
||||||
this.effect.enabled = false;
|
this.effect.enabled = false;
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user