tetromino    15/06/11 00:33:29

  Added:                clutter-1.22.2-clutter_gdk_get_visual.patch
                        clutter-1.22.2-touchpad-detection.patch
                        clutter-1.22.2-cogl-visual-xlib.patch
                        clutter-1.22.2-clutter_gdk_get_visual-2.patch
  Log:
  Add upstream patch to fix touchpad detection. Add upstream patches to fix 
totem crashes with nvidia-drivers (bug #549036, thanks to Harris Landgarten and 
Pacho Ramos).
  
  (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 
0x18E5B6F2D8D5EC8D)

Revision  Changes    Path
1.1                  
media-libs/clutter/files/clutter-1.22.2-clutter_gdk_get_visual.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.22.2-clutter_gdk_get_visual.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.22.2-clutter_gdk_get_visual.patch?rev=1.1&content-type=text/plain

Index: clutter-1.22.2-clutter_gdk_get_visual.patch
===================================================================
>From ab63b30a9b1812b0e53bcddcd55f00fd507347dc Mon Sep 17 00:00:00 2001
From: Emmanuele Bassi <eba...@gnome.org>
Date: Wed, 10 Jun 2015 12:02:13 +0100
Subject: [PATCH 2/3] gdk: Add function to retrieve the GdkVisual

Straight from Cogl.

This allows us to propagate the GdkVisual Cogl and Clutter use to
embedding toolkits, like GTK+.

The function is annotated as being added to the 1.22 development
cycle because it will be backported to the stable branch, so that
downstream developers can package up a version of Clutter that does
not crash on nVidia.

https://bugzilla.gnome.org/show_bug.cgi?id=747489
(cherry picked from commit 2d5b5aa82aacab7cc523e5877afbb864592b7651)
Signed-off-by: Emmanuele Bassi <eba...@gnome.org>
---
 clutter/gdk/clutter-backend-gdk.c          | 48 ++++++++++++++++++++++++++++++
 clutter/gdk/clutter-gdk.h                  |  3 ++
 doc/reference/clutter/clutter-sections.txt |  1 +
 3 files changed, 52 insertions(+)

diff --git a/clutter/gdk/clutter-backend-gdk.c 
b/clutter/gdk/clutter-backend-gdk.c
index 47bd671..01ba8cb 100644
--- a/clutter/gdk/clutter-backend-gdk.c
+++ b/clutter/gdk/clutter-backend-gdk.c
@@ -498,3 +498,51 @@ clutter_gdk_disable_event_retrieval (void)
 
   disable_event_retrieval = TRUE;
 }
+
+/**
+ * clutter_gdk_get_visual:
+ *
+ * Retrieves the #GdkVisual used by Clutter.
+ *
+ * This function should be used when embedding Clutter inside GDK-based
+ * foreign toolkits, to ensure that the visual applied to the #GdkWindow
+ * used to render the #ClutterStage is the correct one.
+ *
+ * Returns: (transfer none): a #GdkVisual instance
+ *
+ * Since: 1.22
+ */
+GdkVisual *
+clutter_gdk_get_visual (void)
+{
+  ClutterBackend *backend = clutter_get_default_backend ();
+  GdkScreen *screen;
+
+  if (backend == NULL)
+    {
+      g_critical ("The Clutter backend has not been initialised");
+      return NULL;
+    }
+
+  if (!CLUTTER_IS_BACKEND_GDK (backend))
+    {
+      g_critical ("The Clutter backend is not a GDK backend");
+      return NULL;
+    }
+
+  screen = CLUTTER_BACKEND_GDK (backend)->screen;
+  g_assert (screen != NULL);
+
+#if defined(GDK_WINDOWING_X11) && defined(COGL_HAS_XLIB_SUPPORT)
+  {
+    XVisualInfo *xvisinfo = cogl_clutter_winsys_xlib_get_visual_info ();
+    if (xvisinfo != NULL)
+      return gdk_x11_screen_lookup_visual (screen, xvisinfo->visualid);
+  }
+#endif
+
+  if (gdk_screen_get_rgba_visual (screen) != NULL)
+    return gdk_screen_get_rgba_visual (screen);
+
+  return gdk_screen_get_system_visual (screen);
+}
diff --git a/clutter/gdk/clutter-gdk.h b/clutter/gdk/clutter-gdk.h
index a009378..c5b979b 100644
--- a/clutter/gdk/clutter-gdk.h
+++ b/clutter/gdk/clutter-gdk.h
@@ -61,6 +61,9 @@ ClutterStage *  clutter_gdk_get_stage_from_window       
(GdkWindow    *window);
 CLUTTER_AVAILABLE_IN_1_10
 void            clutter_gdk_disable_event_retrieval     (void);
 
+CLUTTER_AVAILABLE_IN_1_22
+GdkVisual *     clutter_gdk_get_visual                  (void);
+
 G_END_DECLS
 
 #endif /* __CLUTTER_GDK_H__ */
diff --git a/doc/reference/clutter/clutter-sections.txt 
b/doc/reference/clutter/clutter-sections.txt
index 327f185..d521dc1 100644
--- a/doc/reference/clutter/clutter-sections.txt
+++ b/doc/reference/clutter/clutter-sections.txt
@@ -1516,6 +1516,7 @@ clutter_gdk_handle_event
 clutter_gdk_set_display
 clutter_gdk_get_default_display
 clutter_gdk_set_stage_foreign
+clutter_gdk_get_visual
 </SECTION>
 
 <SECTION>
-- 
2.4.3




1.1                  
media-libs/clutter/files/clutter-1.22.2-touchpad-detection.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.22.2-touchpad-detection.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.22.2-touchpad-detection.patch?rev=1.1&content-type=text/plain

Index: clutter-1.22.2-touchpad-detection.patch
===================================================================
>From a4aad807d5cc6842043e12897cfac3a516825c0f Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagoma...@gmail.com>
Date: Sun, 17 May 2015 00:50:56 +0200
Subject: [PATCH] x11: Fix touchpad detection

Commit 79849ef1d5fff9acd310cd68d59df0c7cf2cb28f had a typo in the
device property format check. This property is formated in 8-bit
items, not 32-bit.

This went unnoticed till now because some touchpads were still being
detected as such due to a second check below:

      else if (strstr (name, "touchpad") != NULL)
        source = CLUTTER_TOUCHPAD_DEVICE;

https://bugzilla.gnome.org/show_bug.cgi?id=749482
---
 clutter/x11/clutter-device-manager-xi2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clutter/x11/clutter-device-manager-xi2.c 
b/clutter/x11/clutter-device-manager-xi2.c
index 17c491e..1b101c4 100644
--- a/clutter/x11/clutter-device-manager-xi2.c
+++ b/clutter/x11/clutter-device-manager-xi2.c
@@ -242,7 +242,7 @@ is_touchpad_device (ClutterBackendX11 *backend_x11,
   /* We don't care about the data */
   XFree (data);
 
-  if (rc != Success || type != XA_INTEGER || format != 32 || nitems != 1)
+  if (rc != Success || type != XA_INTEGER || format != 8 || nitems != 1)
     return FALSE;
 
   return TRUE;
-- 
2.4.3




1.1                  
media-libs/clutter/files/clutter-1.22.2-cogl-visual-xlib.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.22.2-cogl-visual-xlib.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.22.2-cogl-visual-xlib.patch?rev=1.1&content-type=text/plain

Index: clutter-1.22.2-cogl-visual-xlib.patch
===================================================================
>From 44fc1c87489bb7bbe1d28eb0f551794db333e1fb Mon Sep 17 00:00:00 2001
From: Emmanuele Bassi <eba...@gnome.org>
Date: Wed, 10 Jun 2015 11:55:50 +0100
Subject: [PATCH 1/3] gdk: Use the Cogl visual on Xlib winsys
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

GDK 3.16 started selecting different visuals, to best comply with the
requirements for OpenGL, and this has broken Clutter on GLX drivers that
are fairly picky in how they select visuals and GLXFBConfig.

GDK selects GLXFBConfig that do not include depth or stencil buffers;
Cogl, on the other hand, needs both depth and stencil buffers, and keeps
selecting the first available visual, assuming that the GLX driver will
give us the best compliant one, as per specification. Sadly, some
drivers will return incompatible configurations, and then bomb out when
you try to embed Clutter inside GTK+, because of mismatched visuals.

Cogl has an old, deprecated, Clutter-only API that allows us to retrieve
the XVisualInfo mapping to the GLXFBConfig it uses; this means we should
look up the GdkVisual for it when creating our own GdkWindows, instead
of relying on the RGBA and system GdkVisuals exposed by GDK — at least
on X11.

https://bugzilla.gnome.org/show_bug.cgi?id=747489
(cherry picked from commit c91621e8c28bb190eaa9d59e08b180589a255cf3)
Signed-off-by: Emmanuele Bassi <eba...@gnome.org>
---
 clutter/gdk/clutter-stage-gdk.c | 50 ++++++++++++++++++++++++++++++-----------
 1 file changed, 37 insertions(+), 13 deletions(-)

diff --git a/clutter/gdk/clutter-stage-gdk.c b/clutter/gdk/clutter-stage-gdk.c
index e855a98..82f7679 100644
--- a/clutter/gdk/clutter-stage-gdk.c
+++ b/clutter/gdk/clutter-stage-gdk.c
@@ -29,6 +29,10 @@
 
 #include <cogl/cogl.h>
 
+#ifdef COGL_HAS_XLIB_SUPPORT
+#include <cogl/cogl-xlib.h>
+#endif
+
 #define GDK_DISABLE_DEPRECATION_WARNINGS
 
 #include <gdk/gdk.h>
@@ -183,7 +187,7 @@ clutter_stage_gdk_realize (ClutterStageWindow *stage_window)
   GdkWindowAttr attributes;
   gboolean cursor_visible;
   gboolean use_alpha;
-  gfloat   width, height;
+  gfloat width, height;
 
   if (backend->cogl_context == NULL)
     {
@@ -191,12 +195,7 @@ clutter_stage_gdk_realize (ClutterStageWindow 
*stage_window)
       return FALSE;
     }
 
-  if (stage_gdk->foreign_window)
-    {
-      width = gdk_window_get_width (stage_gdk->window);
-      height = gdk_window_get_height (stage_gdk->window);
-    }
-  else
+  if (!stage_gdk->foreign_window)
     {
       if (stage_gdk->window != NULL)
         {
@@ -239,13 +238,34 @@ clutter_stage_gdk_realize (ClutterStageWindow 
*stage_window)
               attributes.cursor = stage_gdk->blank_cursor;
             }
 
-          attributes.visual = NULL;
+          /* If the ClutterStage:use-alpha is set, but GDK does not have an
+           * RGBA visual, then we unset the property on the Stage
+           */
           if (use_alpha)
             {
-              attributes.visual = gdk_screen_get_rgba_visual 
(backend_gdk->screen);
+              if (gdk_screen_get_rgba_visual (backend_gdk->screen) == NULL)
+                {
+                  clutter_stage_set_use_alpha (stage_cogl->wrapper, FALSE);
+                  use_alpha = FALSE;
+                }
+            }
 
-              if (attributes.visual == NULL)
-                clutter_stage_set_use_alpha (stage_cogl->wrapper, FALSE);
+#if defined(GDK_WINDOWING_X11) && defined(COGL_HAS_XLIB_SUPPORT)
+          if (GDK_IS_X11_DISPLAY (backend_gdk->display))
+            {
+              XVisualInfo *xvisinfo = cogl_clutter_winsys_xlib_get_visual_info 
();
+              if (xvisinfo != NULL)
+                {
+                  attributes.visual = gdk_x11_screen_lookup_visual 
(backend_gdk->screen,
+                                                                    
xvisinfo->visualid);
+                }
+            }
+          else
+#endif
+            {
+              attributes.visual = use_alpha
+                                ? gdk_screen_get_rgba_visual 
(backend_gdk->screen)
+                                : gdk_screen_get_system_visual 
(backend_gdk->screen);
             }
 
           if (attributes.visual == NULL)
@@ -263,11 +283,15 @@ clutter_stage_gdk_realize (ClutterStageWindow 
*stage_window)
 
       clutter_stage_gdk_set_gdk_geometry (stage_gdk);
     }
+  else
+    {
+      width = gdk_window_get_width (stage_gdk->window);
+      height = gdk_window_get_height (stage_gdk->window);
+    }
 
   gdk_window_ensure_native (stage_gdk->window);
 
-  g_object_set_data (G_OBJECT (stage_gdk->window),
-                     "clutter-stage-window", stage_gdk);
+  g_object_set_data (G_OBJECT (stage_gdk->window), "clutter-stage-window", 
stage_gdk);
 
   stage_cogl->onscreen = cogl_onscreen_new (backend->cogl_context,
                                            width, height);
-- 
2.4.3




1.1                  
media-libs/clutter/files/clutter-1.22.2-clutter_gdk_get_visual-2.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.22.2-clutter_gdk_get_visual-2.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-libs/clutter/files/clutter-1.22.2-clutter_gdk_get_visual-2.patch?rev=1.1&content-type=text/plain

Index: clutter-1.22.2-clutter_gdk_get_visual-2.patch
===================================================================
>From 19064c4f444ed3fd596580cb98876619133c7f22 Mon Sep 17 00:00:00 2001
From: Emmanuele Bassi <eba...@gnome.org>
Date: Wed, 10 Jun 2015 19:13:13 +0100
Subject: [PATCH 3/3] build: Reset interface_age

We don't usually add symbols inside a stable branch, but given that the
newly added clutter_gdk_get_visual() function is necessary to make
Clutter work when embedded inside GTK running on nVidia binary drivers,
I decided to break the rule. This requires resetting the interface age,
so that the soname version changes.

https://bugzilla.gnome.org/show_bug.cgi?id=747489
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ed67ea1..5b590ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,7 @@ m4_define([clutter_micro_version], [3])
 #   ...
 #
 # • for development releases: keep clutter_interface_age to 0
-m4_define([clutter_interface_age], [2])
+m4_define([clutter_interface_age], [0])
 
 m4_define([clutter_binary_age], [m4_eval(100 * clutter_minor_version + 
clutter_micro_version)])
 
-- 
2.4.3





Reply via email to