[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#519103: compiz: Patch from upstream repository



Package: compiz
Version: 0.7.6-8
Tags: patch
Followup-For: Bug #519103

Commit c2ccf359680cff11e136b7c93b874068ab8b2c02 from the compiz git repository fixes this issue. The patch 
applies cleanly to the current package, and the rebuilt version fixes the bug. 

To achieve the desired effect requires that the package be built against libmetacity-dev > 2.24.0 
(actually, 2.23.2, but this was never packaged). Thus, my included patch makes this change in 
debian/control. However, the code checks for this and falls back appropriately, so back-porters could 
remove the version constraint and still get a working package.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages compiz depends on:
ii  compiz-core                0.7.6-8+phil1 OpenGL window and compositing mana
ii  compiz-gnome               0.7.6-8+phil1 OpenGL window and compositing mana
ii  compiz-gtk                 0.7.6-8+phil1 OpenGL window and compositing mana
ii  compiz-plugins             0.7.6-8+phil1 OpenGL window and compositing mana

compiz recommends no packages.

Versions of packages compiz suggests:
ii  compizconfig-settings-manager 0.7.6-3    Compizconfig Settings Manager

-- no debconf information
commit c2ccf359680cff11e136b7c93b874068ab8b2c02
Author: Michael Vogt <mvo@ubuntu.com>
Date:   Tue Jun 10 06:29:41 2008 +0200

    Re-sync Metacity button parsing code with Metacity to support new "spacer" feature.

diff --git a/configure.ac b/configure.ac
index d04bca9..fbbf560 100644
--- a/configure.ac
+++ b/configure.ac
@@ -326,6 +326,8 @@ if test "x$use_gtk" = "xyes"; then
 		       [have_metacity_2_15_21=yes], [have_metacity_2_15_21=no])
       PKG_CHECK_EXISTS(libmetacity-private >= 2.17.0,
 		       [have_metacity_2_17_0=yes], [have_metacity_2_17_0=no])
+      PKG_CHECK_EXISTS(libmetacity-private >= 2.23.2,
+		       [have_metacity_2_23_2=yes], [have_metacity_2_23_2=no])
     fi
 
     if test "x$use_gnome" = "xyes"; then
@@ -379,6 +381,10 @@ if test "$use_metacity" = yes; then
     AC_DEFINE(HAVE_METACITY_2_17_0, 1,
 	      [Define to 1 if metacity version >= 2.17.0])
   fi
+  if test "$have_metacity_2_23_2" = yes; then
+    AC_DEFINE(HAVE_METACITY_2_23_2, 1,
+	      [Define to 1 if metacity version >= 2.23.2])
+  fi
 fi
 
 AM_CONDITIONAL(USE_GNOME, test "x$use_gnome" = "xyes")
diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c
index 0ebb2d7..4802c93 100644
--- a/gtk/window-decorator/gtk-window-decorator.c
+++ b/gtk/window-decorator/gtk-window-decorator.c
@@ -5949,11 +5949,17 @@ meta_update_button_layout (const char *value)
 
     if (sides[0] != NULL)
     {
-	gboolean used[META_BUTTON_FUNCTION_LAST];
 	char	 **buttons;
 	int	 b;
+	gboolean used[META_BUTTON_FUNCTION_LAST];
 
-	memset (used, 0, sizeof (used));
+	for (i = 0; i < META_BUTTON_FUNCTION_LAST; i++)
+	{
+	   used[i] = FALSE;
+#ifdef HAVE_METACITY_2_23_2
+	   new_layout.left_buttons_has_spacer[i] = FALSE;
+#endif
+        }
 
 	buttons = g_strsplit (sides[0], ",", -1);
 
@@ -5961,54 +5967,90 @@ meta_update_button_layout (const char *value)
 	while (buttons[b] != NULL)
 	{
 	    f = meta_button_function_from_string (buttons[b]);
-	    if (f != META_BUTTON_FUNCTION_LAST && !used[f])
-	    {
-		new_layout.left_buttons[i++] = f;
-		used[f] = TRUE;
-
-		f = meta_button_opposite_function (f);
-		if (f != META_BUTTON_FUNCTION_LAST)
-		    new_layout.left_buttons[i++] = f;
-	    }
+#ifdef HAVE_METACITY_2_23_2
+	    if (i > 0 && strcmp("spacer", buttons[b]) == 0)
+            {
+	       new_layout.left_buttons_has_spacer[i - 1] = TRUE;
+	       f = meta_button_opposite_function (f);
+
+	       if (f != META_BUTTON_FUNCTION_LAST)
+                  new_layout.left_buttons_has_spacer[i - 2] = TRUE;
+            }
 	    else
+#endif
 	    {
-		fprintf (stderr, "%s: Ignoring unknown or already-used "
-			 "button name \"%s\"\n", program_name, buttons[b]);
+	       if (f != META_BUTTON_FUNCTION_LAST && !used[f])
+	       {
+                  used[f] = TRUE;
+                  new_layout.left_buttons[i++] = f;
+
+		  f = meta_button_opposite_function (f);
+
+                  if (f != META_BUTTON_FUNCTION_LAST)
+                      new_layout.left_buttons[i++] = f;
+
+	       }
+	       else
+	       {
+		  fprintf (stderr, "%s: Ignoring unknown or already-used "
+			   "button name \"%s\"\n", program_name, buttons[b]);
+	       }
 	    }
-
 	    b++;
 	}
 
+	new_layout.left_buttons[i] = META_BUTTON_FUNCTION_LAST;
+
 	g_strfreev (buttons);
 
 	if (sides[1] != NULL)
 	{
-	    memset (used, 0, sizeof (used));
+	    for (i = 0; i < META_BUTTON_FUNCTION_LAST; i++)
+	    {
+		used[i] = FALSE;
+#ifdef HAVE_METACITY_2_23_2
+		new_layout.right_buttons_has_spacer[i] = FALSE;
+#endif
+	    }
 
 	    buttons = g_strsplit (sides[1], ",", -1);
 
 	    i = b = 0;
 	    while (buttons[b] != NULL)
 	    {
-		f = meta_button_function_from_string (buttons[b]);
-		if (f != META_BUTTON_FUNCTION_LAST && !used[f])
-		{
-		    new_layout.right_buttons[i++] = f;
-		    used[f] = TRUE;
-
-		    f = meta_button_opposite_function (f);
-		    if (f != META_BUTTON_FUNCTION_LAST)
-			new_layout.right_buttons[i++] = f;
-		}
-		else
-		{
-		    fprintf (stderr, "%s: Ignoring unknown or already-used "
-			     "button name \"%s\"\n", program_name, buttons[b]);
-		}
-
-		b++;
+	       f = meta_button_function_from_string (buttons[b]);
+#ifdef HAVE_METACITY_2_23_2
+	       if (i > 0 && strcmp("spacer", buttons[b]) == 0)
+	       {
+		  new_layout.right_buttons_has_spacer[i - 1] = TRUE;
+		  f = meta_button_opposite_function (f);
+		  if (f != META_BUTTON_FUNCTION_LAST)
+		     new_layout.right_buttons_has_spacer[i - 2] = TRUE;
+	       }
+	       else
+#endif
+	       {
+		   if (f != META_BUTTON_FUNCTION_LAST && !used[f])
+		   {
+		       used[f] = TRUE;
+		       new_layout.right_buttons[i++] = f;
+
+		       f = meta_button_opposite_function (f);
+
+		       if (f != META_BUTTON_FUNCTION_LAST)
+			   new_layout.right_buttons[i++] = f;
+		   }
+		   else
+		   {
+		       fprintf (stderr, "%s: Ignoring unknown or "
+				"already-used button name \"%s\"\n",
+				program_name, buttons[b]);
+		   }
+	       }
+	       b++;
 	    }
-
+	    new_layout.right_buttons[i] = META_BUTTON_FUNCTION_LAST;
+	    
 	    g_strfreev (buttons);
 	}
     }
--- a/debian/control	2009-03-17 23:36:29.000000000 -0500
+++ b/debian/control	2009-03-18 00:20:16.000000000 -0500
@@ -8,10 +8,11 @@
  libdbus-glib-1-dev, libgconf2-dev, 
  libgl1-mesa-dev (>= 6.5.1) | libgl-dev, libglib2.0-dev, libgnome-desktop-dev, 
  libgnome-window-settings-dev, libgtk2.0-dev, libice-dev (>= 1:1.0.1), 
- libmetacity-dev, libpango1.0-dev, libpng12-dev | libpng-dev, librsvg2-dev, 
- libsm-dev (>= 1:1.0.1), libtool, libwnck-dev, libxcomposite-dev (>= 1:0.3-2), 
- libxdamage-dev (>=1:1.0.3), libxfixes-dev (>= 1:4.0.1), libxinerama-dev, 
- libxml-parser-perl, libxrandr-dev (>= 2:1.1.0.2), libxrender-dev (>= 1:0.9.1), 
+ libmetacity-dev (>= 1:2.24.0), libpango1.0-dev, libpng12-dev | libpng-dev, 
+ librsvg2-dev, libsm-dev (>= 1:1.0.1), libtool, libwnck-dev, 
+ libxcomposite-dev (>= 1:0.3-2), libxdamage-dev (>=1:1.0.3), 
+ libxfixes-dev (>= 1:4.0.1), libxinerama-dev, libxml-parser-perl, 
+ libxrandr-dev (>= 2:1.1.0.2), libxrender-dev (>= 1:0.9.1), 
  quilt (>= 0.40), x11proto-gl-dev (>= 1.4.8), xsltproc
 Standards-Version: 3.7.3
 

Reply to: