[gnome-shell] WindowDimmer: Don't try to use a ShaderEffect when GLSL	is not available
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-shell] WindowDimmer: Don't try to use a ShaderEffect when GLSL	is not available
- Date: Mon,  3 Oct 2011 16:22:37 +0000 (UTC)
commit 130f2cf80891db16e6fdebc584f2c0c89e3cafef
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Mon Oct 3 18:11:59 2011 +0200
    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.
 js/ui/windowManager.js |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 728b133..ab82c06 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -37,14 +37,23 @@ function WindowDimmer(actor) {
 
 WindowDimmer.prototype = {
     _init: function(actor) {
-        this.effect = new Clutter.ShaderEffect({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER });
-        this.effect.set_shader_source(getDimShaderSource());
+        if (Clutter.feature_available(Clutter.FeatureFlags.SHADERS_GLSL)) {
+            this.effect = new Clutter.ShaderEffect({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER });
+            this.effect.set_shader_source(getDimShaderSource());
+        }
+        else {
+            this._effect = null;
+        }
 
         this.actor = actor;
     },
 
     set dimFraction(fraction) {
         this._dimFraction = fraction;
+
+        if (this.effect == null)
+            return;
+
         if (!Meta.prefs_get_attach_modal_dialogs()) {
             this.effect.enabled = false;
             return;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]