r39219 - in /desktop/unstable/gnome-shell/debian: ./ patches/

ah at users.alioth.debian.org ah at users.alioth.debian.org
Thu Aug 22 11:49:47 UTC 2013


Author: ah
Date: Thu Aug 22 11:49:46 2013
New Revision: 39219

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=39219
Log:
* Add patches from upstream to replace custom shader (which is causing
  problems with recent clutter versions) with builtin ClutterEffects:
  - 0001-windowManager-Remove-unused-function.patch
  - 0002-windowManager-Remove-animate-parameter-from-un-dimWi.patch
  - 0003-windowManager-Replace-custom-shader-with-builtin-Clu.patch
  (First to patches are included only to make the third one apply)

Added:
    desktop/unstable/gnome-shell/debian/patches/0001-windowManager-Remove-unused-function.patch
    desktop/unstable/gnome-shell/debian/patches/0002-windowManager-Remove-animate-parameter-from-un-dimWi.patch
    desktop/unstable/gnome-shell/debian/patches/0003-windowManager-Replace-custom-shader-with-builtin-Clu.patch
Modified:
    desktop/unstable/gnome-shell/debian/changelog
    desktop/unstable/gnome-shell/debian/patches/series

Modified: desktop/unstable/gnome-shell/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/changelog?rev=39219&op=diff
==============================================================================
--- desktop/unstable/gnome-shell/debian/changelog	[utf-8] (original)
+++ desktop/unstable/gnome-shell/debian/changelog	[utf-8] Thu Aug 22 11:49:46 2013
@@ -1,3 +1,14 @@
+gnome-shell (3.4.2-15) UNRELEASED; urgency=low
+
+  * Add patches from upstream to replace custom shader (which is causing
+    problems with recent clutter versions) with builtin ClutterEffects:
+    - 0001-windowManager-Remove-unused-function.patch
+    - 0002-windowManager-Remove-animate-parameter-from-un-dimWi.patch
+    - 0003-windowManager-Replace-custom-shader-with-builtin-Clu.patch
+    (First to patches are included only to make the third one apply)
+
+ -- Andreas Henriksson <andreas at fatal.se>  Thu, 22 Aug 2013 13:38:15 +0200
+
 gnome-shell (3.4.2-14) unstable; urgency=low
 
   * debian/patches/avoid-gluint.patch:

Added: desktop/unstable/gnome-shell/debian/patches/0001-windowManager-Remove-unused-function.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/0001-windowManager-Remove-unused-function.patch?rev=39219&op=file
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/0001-windowManager-Remove-unused-function.patch	(added)
+++ desktop/unstable/gnome-shell/debian/patches/0001-windowManager-Remove-unused-function.patch	[utf-8] Thu Aug 22 11:49:46 2013
@@ -0,0 +1,30 @@
+From 108a54b54194c5957a46f16575d625319553ee46 Mon Sep 17 00:00:00 2001
+From: "Jasper St. Pierre" <jstpierre at mecheye.net>
+Date: Thu, 5 Jul 2012 14:52:01 -0400
+Subject: [PATCH 1/3] windowManager: Remove unused function
+
+https://bugzilla.gnome.org/show_bug.cgi?id=679500
+---
+ js/ui/windowManager.js | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
+index c6b17ad..a02d8af 100644
+--- a/js/ui/windowManager.js
++++ b/js/ui/windowManager.js
+@@ -26,12 +26,6 @@ function getDimShaderSource() {
+     return dimShader;
+ }
+ 
+-function getTopInvisibleBorder(metaWindow) {
+-    let outerRect = metaWindow.get_outer_rect();
+-    let inputRect = metaWindow.get_input_rect();
+-    return outerRect.y - inputRect.y;
+-}
+-
+ const WindowDimmer = new Lang.Class({
+     Name: 'WindowDimmer',
+ 
+-- 
+1.8.4.rc3
+

Added: desktop/unstable/gnome-shell/debian/patches/0002-windowManager-Remove-animate-parameter-from-un-dimWi.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/0002-windowManager-Remove-animate-parameter-from-un-dimWi.patch?rev=39219&op=file
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/0002-windowManager-Remove-animate-parameter-from-un-dimWi.patch	(added)
+++ desktop/unstable/gnome-shell/debian/patches/0002-windowManager-Remove-animate-parameter-from-un-dimWi.patch	[utf-8] Thu Aug 22 11:49:46 2013
@@ -0,0 +1,93 @@
+From 0e84fdcb222c9dca8ca14ad715b0a9333f6151da Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner at gnome.org>
+Date: Sat, 14 Jul 2012 01:37:10 +0200
+Subject: [PATCH 2/3] windowManager: Remove 'animate' parameter from
+ (un)dimWindow()
+
+The parameter has become rather pointless since we always pass the
+same value.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=674499
+---
+ js/ui/windowManager.js | 38 ++++++++++++++++----------------------
+ 1 file changed, 16 insertions(+), 22 deletions(-)
+
+diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
+index a02d8af..499f951 100644
+--- a/js/ui/windowManager.js
++++ b/js/ui/windowManager.js
+@@ -136,11 +136,11 @@ const WindowManager = new Lang.Class({
+ 
+         Main.overview.connect('showing', Lang.bind(this, function() {
+             for (let i = 0; i < this._dimmedWindows.length; i++)
+-                this._undimWindow(this._dimmedWindows[i], true);
++                this._undimWindow(this._dimmedWindows[i]);
+         }));
+         Main.overview.connect('hiding', Lang.bind(this, function() {
+             for (let i = 0; i < this._dimmedWindows.length; i++)
+-                this._dimWindow(this._dimmedWindows[i], true);
++                this._dimWindow(this._dimmedWindows[i]);
+         }));
+     },
+ 
+@@ -254,43 +254,37 @@ const WindowManager = new Lang.Class({
+             window._dimmed = true;
+             this._dimmedWindows.push(window);
+             if (!Main.overview.visible)
+-                this._dimWindow(window, true);
++                this._dimWindow(window);
+         } else if (!shouldDim && window._dimmed) {
+             window._dimmed = false;
+             this._dimmedWindows = this._dimmedWindows.filter(function(win) {
+                                                                  return win != window;
+                                                              });
+             if (!Main.overview.visible)
+-                this._undimWindow(window, true);
++                this._undimWindow(window);
+         }
+     },
+ 
+-    _dimWindow: function(window, animate) {
++    _dimWindow: function(window) {
+         let actor = window.get_compositor_private();
+         if (!actor)
+             return;
+-        if (animate)
+-            Tweener.addTween(getWindowDimmer(actor),
+-                             { dimFraction: 1.0,
+-                               time: DIM_TIME,
+-                               transition: 'linear'
+-                             });
+-        else
+-            getWindowDimmer(actor).dimFraction = 1.0;
++        Tweener.addTween(getWindowDimmer(actor),
++                         { dimFraction: 1.0,
++                           time: DIM_TIME,
++                           transition: 'linear'
++                         });
+     },
+ 
+-    _undimWindow: function(window, animate) {
++    _undimWindow: function(window) {
+         let actor = window.get_compositor_private();
+         if (!actor)
+             return;
+-        if (animate)
+-            Tweener.addTween(getWindowDimmer(actor),
+-                             { dimFraction: 0.0,
+-                               time: UNDIM_TIME,
+-                               transition: 'linear'
+-                             });
+-        else
+-            getWindowDimmer(actor).dimFraction = 0.0;
++        Tweener.addTween(getWindowDimmer(actor),
++                         { dimFraction: 0.0,
++                           time: UNDIM_TIME,
++                           transition: 'linear'
++                         });
+     },
+ 
+     _mapWindow : function(shellwm, actor) {
+-- 
+1.8.4.rc3
+

Added: desktop/unstable/gnome-shell/debian/patches/0003-windowManager-Replace-custom-shader-with-builtin-Clu.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/0003-windowManager-Replace-custom-shader-with-builtin-Clu.patch?rev=39219&op=file
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/0003-windowManager-Replace-custom-shader-with-builtin-Clu.patch	(added)
+++ desktop/unstable/gnome-shell/debian/patches/0003-windowManager-Replace-custom-shader-with-builtin-Clu.patch	[utf-8] Thu Aug 22 11:49:46 2013
@@ -0,0 +1,248 @@
+From 861028f69a91dd23f16f1940b8e6ea99b266761e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner at gnome.org>
+Date: Fri, 13 Jul 2012 19:57:36 +0200
+Subject: [PATCH 3/3] windowManager: Replace custom shader with builtin
+ ClutterEffects
+
+While modal dialogs were attached to the parent's titlebar, it
+made sense to leave the top of the parent window at full color.
+With the new position of modal dialogs, it makes more sense to dim
+the entire parent window, so we can use a combination of Clutter's
+BrightnessContrast- and DesaturateEffect instead of our own custom
+shader.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=674499
+---
+ data/Makefile.am             |  6 ----
+ data/shaders/dim-window.glsl | 27 ----------------
+ js/ui/windowManager.js       | 73 +++++++++++++++++++-------------------------
+ src/shell-util.c             | 28 -----------------
+ src/shell-util.h             |  4 ---
+ 5 files changed, 31 insertions(+), 107 deletions(-)
+ delete mode 100644 data/shaders/dim-window.glsl
+
+diff --git a/data/Makefile.am b/data/Makefile.am
+index e4ac9bb..56e2602 100644
+--- a/data/Makefile.am
++++ b/data/Makefile.am
+@@ -68,17 +68,11 @@ all-local: gschemas.compiled
+ convertdir = $(datadir)/GConf/gsettings
+ convert_DATA = gnome-shell-overrides.convert
+ 
+-shadersdir = $(pkgdatadir)/shaders
+-shaders_DATA = \
+-	shaders/dim-window.glsl
+-
+-
+ EXTRA_DIST =						\
+ 	gnome-shell.desktop.in.in			\
+ 	gnome-shell-extension-prefs.desktop.in.in	\
+ 	$(introspection_DATA)				\
+ 	$(menu_DATA)					\
+-	$(shaders_DATA)					\
+ 	$(convert_DATA)					\
+ 	org.gnome.shell.evolution.calendar.gschema.xml.in	\
+ 	org.gnome.shell.gschema.xml.in
+diff --git a/data/shaders/dim-window.glsl b/data/shaders/dim-window.glsl
+deleted file mode 100644
+index c7c8c1b..0000000
+--- a/data/shaders/dim-window.glsl
++++ /dev/null
+@@ -1,27 +0,0 @@
+-#version 110
+-uniform sampler2D tex;
+-uniform float fraction;
+-uniform float height;
+-const float c = -0.2;
+-const float border_max_height = 60.0;
+-
+-mat4 contrast = mat4 (1.0 + c, 0.0, 0.0, 0.0,
+-                      0.0, 1.0 + c, 0.0, 0.0,
+-                      0.0, 0.0, 1.0 + c, 0.0,
+-                      0.0, 0.0, 0.0, 1.0);
+-vec4 off = vec4(0.633, 0.633, 0.633, 0);
+-void main()
+-{
+-  vec4 color = texture2D(tex, cogl_tex_coord_in[0].xy);
+-  float y = height * cogl_tex_coord_in[0].y;
+-
+-  // To reduce contrast, blend with a mid gray
+-  cogl_color_out = color * contrast - off * c * color.a;
+-
+-  // We only fully dim at a distance of BORDER_MAX_HEIGHT from the top and
+-  // when the fraction is 1.0. For other locations and fractions we linearly
+-  // interpolate back to the original undimmed color, so the top of the window
+-  // is at full color.
+-  cogl_color_out = color + (cogl_color_out - color) * max(min(y / border_max_height, 1.0), 0.0);
+-  cogl_color_out = color + (cogl_color_out - color) * fraction;
+-}
+diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
+index 499f951..55cf075 100644
+--- a/js/ui/windowManager.js
++++ b/js/ui/windowManager.js
+@@ -15,59 +15,38 @@ const Tweener = imports.ui.tweener;
+ 
+ const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
+ const WINDOW_ANIMATION_TIME = 0.25;
++const DIM_DESATURATION = 0.6;
++const DIM_BRIGHTNESS = -0.1;
+ const DIM_TIME = 0.500;
+ const UNDIM_TIME = 0.250;
+ 
+-var dimShader = undefined;
+-
+-function getDimShaderSource() {
+-    if (!dimShader)
+-        dimShader = Shell.get_file_contents_utf8_sync(global.datadir + '/shaders/dim-window.glsl');
+-    return dimShader;
+-}
+ 
+ const WindowDimmer = new Lang.Class({
+     Name: 'WindowDimmer',
+ 
+     _init: function(actor) {
+-        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._desaturateEffect = new Clutter.DesaturateEffect();
++        this._brightnessEffect = new Clutter.BrightnessContrastEffect();
++        actor.add_effect(this._desaturateEffect);
++        actor.add_effect(this._brightnessEffect);
+         this.actor = actor;
++        this._dimFactor = 0.0;
+     },
+ 
+-    set dimFraction(fraction) {
+-        this._dimFraction = fraction;
+-
+-        if (this._effect == null)
+-            return;
+-
+-        if (!Meta.prefs_get_attach_modal_dialogs()) {
+-            this._effect.enabled = false;
+-            return;
+-        }
+-
+-        if (fraction > 0.01) {
+-            Shell.shader_effect_set_double_uniform(this._effect, 'height', this.actor.get_height());
+-            Shell.shader_effect_set_double_uniform(this._effect, 'fraction', fraction);
+-
+-            if (!this._effect.actor)
+-                this.actor.add_effect(this._effect);
+-        } else {
+-            if (this._effect.actor)
+-                this.actor.remove_effect(this._effect);
+-        }
++    setEnabled: function(enabled) {
++        this._desaturateEffect.enabled = enabled;
++        this._brightnessEffect.enabled = enabled;
+     },
+ 
+-    get dimFraction() {
+-        return this._dimFraction;
++    set dimFactor(factor) {
++        this._dimFactor = factor;
++        this._desaturateEffect.set_factor(factor * DIM_DESATURATION);
++        this._brightnessEffect.set_brightness(factor * DIM_BRIGHTNESS);
+     },
+ 
+-    _dimFraction: 0.0
++    get dimFactor() {
++        return this._dimFactor;
++    }
+ });
+ 
+ function getWindowDimmer(actor) {
+@@ -269,8 +248,13 @@ const WindowManager = new Lang.Class({
+         let actor = window.get_compositor_private();
+         if (!actor)
+             return;
+-        Tweener.addTween(getWindowDimmer(actor),
+-                         { dimFraction: 1.0,
++        let dimmer = getWindowDimmer(actor);
++        let enabled = Meta.prefs_get_attach_modal_dialogs();
++        dimmer.setEnabled(enabled);
++        if (!enabled)
++            return;
++        Tweener.addTween(dimmer,
++                         { dimFactor: 1.0,
+                            time: DIM_TIME,
+                            transition: 'linear'
+                          });
+@@ -280,8 +264,13 @@ const WindowManager = new Lang.Class({
+         let actor = window.get_compositor_private();
+         if (!actor)
+             return;
+-        Tweener.addTween(getWindowDimmer(actor),
+-                         { dimFraction: 0.0,
++        let dimmer = getWindowDimmer(actor);
++        let enabled = Meta.prefs_get_attach_modal_dialogs();
++        dimmer.setEnabled(enabled);
++        if (!enabled)
++            return;
++        Tweener.addTween(dimmer,
++                         { dimFactor: 0.0,
+                            time: UNDIM_TIME,
+                            transition: 'linear'
+                          });
+diff --git a/src/shell-util.c b/src/shell-util.c
+index 0a1baab..1c4808b 100644
+--- a/src/shell-util.c
++++ b/src/shell-util.c
+@@ -796,34 +796,6 @@ shell_parse_search_provider (const char    *data,
+ }
+ 
+ /**
+- * shell_shader_effect_set_double_uniform:
+- * @effect: The #ClutterShaderEffect
+- * @name: The name of the uniform
+- * @value: The value to set it to.
+- *
+- * Set a double uniform on a ClutterShaderEffect.
+- *
+- * The problem here is that JavaScript doesn't have more than
+- * one number type, and gjs tries to automatically guess what
+- * type we want to set a GValue to. If the number is "1.0" or
+- * something, it will use an integer, which will cause errors
+- * in GLSL.
+- */
+-void
+-shell_shader_effect_set_double_uniform (ClutterShaderEffect *effect,
+-                                        const gchar         *name,
+-                                        gdouble             value)
+-{
+-  GValue gvalue = G_VALUE_INIT;
+-  g_value_init (&gvalue, G_TYPE_DOUBLE);
+-  g_value_set_double (&gvalue, value);
+-
+-  clutter_shader_effect_set_uniform_value (effect,
+-                                           name,
+-                                           &gvalue);
+-}
+-
+-/**
+  * shell_session_is_active_for_systemd:
+  *
+  * Checks whether the session we are running in is currently active,
+diff --git a/src/shell-util.h b/src/shell-util.h
+index 9208099..e25e41b 100644
+--- a/src/shell-util.h
++++ b/src/shell-util.h
+@@ -43,10 +43,6 @@ gboolean shell_parse_search_provider           (const char       *data,
+                                                 char            **icon_data_uri,
+                                                 GError          **error);
+ 
+-void shell_shader_effect_set_double_uniform (ClutterShaderEffect *effect,
+-                                             const gchar         *name,
+-                                             gdouble             value);
+-
+ gboolean shell_session_is_active_for_systemd (void);
+ 
+ gboolean shell_util_wifexited                  (int               status,
+-- 
+1.8.4.rc3
+

Modified: desktop/unstable/gnome-shell/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-shell/debian/patches/series?rev=39219&op=diff
==============================================================================
--- desktop/unstable/gnome-shell/debian/patches/series	[utf-8] (original)
+++ desktop/unstable/gnome-shell/debian/patches/series	[utf-8] Thu Aug 22 11:49:46 2013
@@ -21,3 +21,6 @@
 62-remove-leftover-dbus-import.patch
 disable-clutter-xinput.patch
 avoid-gluint.patch
+0001-windowManager-Remove-unused-function.patch
+0002-windowManager-Remove-animate-parameter-from-un-dimWi.patch
+0003-windowManager-Replace-custom-shader-with-builtin-Clu.patch




More information about the pkg-gnome-commits mailing list