--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/metacity-09-branding-hack.diff Fri May 12 12:13:20 2006 +0000
@@ -0,0 +1,267 @@
+--- metacity-2.14.3/src/frames.c 2006-01-21 20:15:47.000000000 +0100
++++ /shared/build/jds/packages/BUILD/SUNWgnome-wm-2.13.92/metacity-2.13.89/src/frames.c 2006-02-24 19:26:36.659248000 +0100
+@@ -757,6 +757,8 @@
+ XRectangle xrect;
+ Region corners_xregion;
+ Region window_xregion;
++ /* hack for nimbus theme */
++ gboolean nimbus_theme = (strcmp ("nimbus", meta_prefs_get_theme ()) == 0) ? TRUE : FALSE;
+
+ frame = meta_frames_lookup_window (frames, xwindow);
+ g_return_if_fail (frame != NULL);
+@@ -793,100 +795,149 @@
+
+ if (fgeom.top_left_corner_rounded)
+ {
+- xrect.x = 0;
+- xrect.y = 0;
+- xrect.width = 5;
+- xrect.height = 1;
+-
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = 1;
+- xrect.width = 3;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = 2;
+- xrect.width = 2;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = 3;
+- xrect.width = 1;
+- xrect.height = 2;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ if (nimbus_theme)
++ {
++ xrect.x = 0;
++ xrect.y = 0;
++ xrect.width = 1;
++ xrect.height = 1;
++
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ }
++ else
++ {
++ xrect.x = 0;
++ xrect.y = 0;
++ xrect.width = 5;
++ xrect.height = 1;
++
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = 1;
++ xrect.width = 3;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = 2;
++ xrect.width = 2;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = 3;
++ xrect.width = 1;
++ xrect.height = 2;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ }
+ }
+
+ if (fgeom.top_right_corner_rounded)
+ {
+- xrect.x = new_window_width - 5;
+- xrect.y = 0;
+- xrect.width = 5;
+- xrect.height = 1;
+-
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = 1;
+- xrect.x = new_window_width - 3;
+- xrect.width = 3;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = 2;
+- xrect.x = new_window_width - 2;
+- xrect.width = 2;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = 3;
+- xrect.x = new_window_width - 1;
+- xrect.width = 1;
+- xrect.height = 2;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ if (nimbus_theme)
++ {
++ xrect.x = new_window_width - 1;
++ xrect.y = 0;
++ xrect.width = 1;
++ xrect.height = 1;
++
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ }
++ else
++ {
++ xrect.x = new_window_width - 5;
++ xrect.y = 0;
++ xrect.width = 5;
++ xrect.height = 1;
++
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = 1;
++ xrect.x = new_window_width - 3;
++ xrect.width = 3;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = 2;
++ xrect.x = new_window_width - 2;
++ xrect.width = 2;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = 3;
++ xrect.x = new_window_width - 1;
++ xrect.width = 1;
++ xrect.height = 2;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ }
+ }
+
+ if (fgeom.bottom_left_corner_rounded)
+ {
+- xrect.x = 0;
+- xrect.y = new_window_height - 1;
+- xrect.width = 5;
+- xrect.height = 1;
+-
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = new_window_height - 2;
+- xrect.width = 3;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = new_window_height - 3;
+- xrect.width = 2;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = new_window_height - 5;
+- xrect.width = 1;
+- xrect.height = 2;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ if (nimbus_theme)
++ {
++ xrect.x = 0;
++ xrect.y = new_window_height - 1;
++ xrect.width = 1;
++ xrect.height = 1;
++
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ }
++ else
++ {
++ xrect.x = 0;
++ xrect.y = new_window_height - 1;
++ xrect.width = 5;
++ xrect.height = 1;
++
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = new_window_height - 2;
++ xrect.width = 3;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = new_window_height - 3;
++ xrect.width = 2;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = new_window_height - 5;
++ xrect.width = 1;
++ xrect.height = 2;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ }
+ }
+
+ if (fgeom.bottom_right_corner_rounded)
+ {
+- xrect.x = new_window_width - 5;
+- xrect.y = new_window_height - 1;
+- xrect.width = 5;
+- xrect.height = 1;
+-
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = new_window_height - 2;
+- xrect.x = new_window_width - 3;
+- xrect.width = 3;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = new_window_height - 3;
+- xrect.x = new_window_width - 2;
+- xrect.width = 2;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
+-
+- xrect.y = new_window_height - 5;
+- xrect.x = new_window_width - 1;
+- xrect.width = 1;
+- xrect.height = 2;
+- XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ if (nimbus_theme)
++ {
++ xrect.x = new_window_width - 1;
++ xrect.y = new_window_height - 1;
++ xrect.width = 1;
++ xrect.height = 1;
++
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ }
++ else
++ {
++ xrect.x = new_window_width - 5;
++ xrect.y = new_window_height - 1;
++ xrect.width = 5;
++ xrect.height = 1;
++
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = new_window_height - 2;
++ xrect.x = new_window_width - 3;
++ xrect.width = 3;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = new_window_height - 3;
++ xrect.x = new_window_width - 2;
++ xrect.width = 2;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++
++ xrect.y = new_window_height - 5;
++ xrect.x = new_window_width - 1;
++ xrect.width = 1;
++ xrect.height = 2;
++ XUnionRectWithRegion (&xrect, corners_xregion, corners_xregion);
++ }
+ }
+
+ window_xregion = XCreateRegion ();
+--- metacity-2.14.3/src/theme-parser.c 2005-11-01 19:49:34.000000000 +0100
++++ /shared/build/jds/packages/BUILD/SUNWgnome-wm-2.13.92/metacity-2.13.89/src/theme-parser.c 2006-02-28 18:35:50.075883000 +0100
+@@ -827,6 +827,21 @@
+ if (rounded_bottom_right && !parse_boolean (rounded_bottom_right, &rounded_bottom_right_val, context, error))
+ return;
+
++ { /* Hack for Nimbus theme - pretend we have rounded corners this way the theme will
++ look Ok in non-patches version of metacity */
++ gboolean nimbus_theme = (strcmp ("nimbus", info->theme_name) == 0) ? TRUE : FALSE;
++ if (nimbus_theme)
++ {
++ rounded_top_left_val = TRUE;
++ rounded_top_right_val = TRUE;
++ rounded_bottom_left_val = TRUE;
++ rounded_bottom_right_val = TRUE;
++ rounded_top_left = TRUE;
++ rounded_top_right = TRUE;
++ rounded_bottom_left = TRUE;
++ rounded_bottom_right = TRUE;
++ }
++ }
+ title_scale_val = 1.0;
+ if (title_scale && !parse_title_scale (title_scale, &title_scale_val, context, error))
+ return;