Blob Blame History Raw
diff -up banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.CairoGlyphs/BansheeLineLogo.cs.cairofix banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.CairoGlyphs/BansheeLineLogo.cs
--- banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.CairoGlyphs/BansheeLineLogo.cs.cairofix	2014-02-18 15:40:14.000000000 -0500
+++ banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.CairoGlyphs/BansheeLineLogo.cs	2017-07-18 13:36:34.005318558 -0400
@@ -84,14 +84,14 @@ namespace Banshee.CairoGlyphs
             cr.LineJoin = LineJoin.Round;
 
             // inner 'b' note
-            cr.Color = innerColor;
+            cr.SetSourceColor (innerColor);
             cr.MoveTo (0, 2);
             cr.LineTo (2, 0);
             cr.Arc (4, 8, 2, Math.PI, Math.PI * 3);
             cr.Stroke ();
 
             // outer 'cut' circle
-            cr.Color = outerColor;
+            cr.SetSourceColor (outerColor);
             cr.Arc (4, 8, 4, Math.PI * 1.5, Math.PI * 1.12);
             cr.Stroke ();
 
diff -up banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs.cairofix banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
--- banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs.cairofix	2014-02-18 15:40:14.000000000 -0500
+++ banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs	2017-07-18 13:36:34.005318558 -0400
@@ -74,7 +74,7 @@ namespace Banshee.Collection.Gui
             if (image != null) {
                 if (fill) {
                     CairoExtensions.RoundedRectangle (cr, x, y, width, height, radius, corners);
-                    cr.Color = fillColor;
+                    cr.SetSourceColor (fillColor);
                     cr.Fill ();
                 }
 
@@ -85,12 +85,12 @@ namespace Banshee.Collection.Gui
                 CairoExtensions.RoundedRectangle (cr, x, y, width, height, radius, corners);
 
                 if (fill) {
-                    var grad = new LinearGradient (x, y, x, y + height);
-                    grad.AddColorStop (0, fillColor);
-                    grad.AddColorStop (1, CairoExtensions.ColorShade (fillColor, 1.3));
-                    cr.Pattern = grad;
-                    cr.Fill ();
-                    grad.Destroy ();
+                    using (var grad = new LinearGradient (x, y, x, y + height)) {
+                        grad.AddColorStop (0, fillColor);
+                        grad.AddColorStop (1, CairoExtensions.ColorShade (fillColor, 1.3));
+                        cr.SetSource (grad);
+                        cr.Fill ();
+                    }
                 }
 
                 Banshee.CairoGlyphs.BansheeLineLogo.Render (cr,
@@ -112,12 +112,12 @@ namespace Banshee.Collection.Gui
                 cr.Antialias = Antialias.None;
 
                 CairoExtensions.RoundedRectangle (cr, x + 1.5, y + 1.5, width - 3, height - 3, radius, corners);
-                cr.Color = cover_border_light_color;
+                cr.SetSourceColor (cover_border_light_color);
                 cr.Stroke ();
             }
 
             CairoExtensions.RoundedRectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1, radius, corners);
-            cr.Color = cover_border_dark_color;
+            cr.SetSourceColor (cover_border_dark_color);
             cr.Stroke ();
 
             if (dispose && image != null) {
diff -up banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs.cairofix banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs
--- banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs.cairofix	2014-02-18 15:40:14.000000000 -0500
+++ banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs	2017-07-18 13:36:34.006318533 -0400
@@ -133,7 +133,7 @@ namespace Banshee.Collection.Gui
             // Render the second line first since we have that state already
             if (!String.IsNullOrEmpty (album.ArtistName)) {
                 context.Context.MoveTo (x, y + fl_height);
-                context.Context.Color = text_color;
+                context.Context.SetSourceColor (text_color);
                 PangoCairoHelper.ShowLayout (context.Context, layout);
             }
 
@@ -147,7 +147,7 @@ namespace Banshee.Collection.Gui
 
             context.Context.MoveTo (x, y);
             text_color.A = 1;
-            context.Context.Color = text_color;
+            context.Context.SetSourceColor (text_color);
             PangoCairoHelper.ShowLayout (context.Context, layout);
         }
 
diff -up banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs.cairofix banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs
--- banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs.cairofix	2014-02-18 15:40:14.000000000 -0500
+++ banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrack.cs	2017-07-18 13:36:34.006318533 -0400
@@ -81,7 +81,7 @@ namespace Banshee.Collection.Gui
             Cairo.Color color = context.Theme.Colors.GetWidgetColor (
                 context.TextAsForeground ? GtkColorClass.Foreground : GtkColorClass.Text, state);
             color.A = (!context.Opaque) ? 0.3 : 1.0;
-            context.Context.Color = color;
+            context.Context.SetSourceColor (color);
 
             PangoCairoHelper.ShowLayout (context.Context, context.Layout);
         }
diff -up banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs.cairofix banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
--- banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs.cairofix	2014-02-18 15:40:14.000000000 -0500
+++ banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs	2017-07-18 13:36:34.006318533 -0400
@@ -210,7 +210,7 @@ namespace Banshee.Gui.Widgets
 
             if (renderTrack) {
                 cr.MoveTo (x, y);
-                cr.Color = TextColor;
+                cr.SetSourceColor (TextColor);
                 PangoCairoHelper.ShowLayout (cr, first_line_layout);
             }
 
diff -up banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs.cairofix banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs
--- banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs.cairofix	2014-02-18 15:40:14.000000000 -0500
+++ banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs	2017-07-18 13:36:34.006318533 -0400
@@ -129,7 +129,7 @@ namespace Banshee.Gui.Widgets
             }
 
             cr.Rectangle (x, y, asr, alloc.Height);
-            cr.Color = BackgroundColor;
+            cr.SetSourceColor (BackgroundColor);
             cr.Fill ();
 
             x += (asr - surface_w) / 2;
@@ -141,40 +141,42 @@ namespace Banshee.Gui.Widgets
 
         private Surface CreateScene (Cairo.Context window_cr, ImageSurface image, int reflect)
         {
-            Surface surface = window_cr.Target.CreateSimilar (window_cr.Target.Content,
-                image.Width, image.Height + reflect);
-            Cairo.Context cr = new Context (surface);
-
-            cr.Save ();
+            Surface surface;
+            using (var t = window_cr.GetTarget ()) {
+                surface = t.CreateSimilar (t.Content, image.Width, image.Height + reflect);
+            }
 
-            cr.SetSource (image);
-            cr.Paint ();
+            using (Cairo.Context cr = new Context (surface)) {
+                cr.Save ();
+                cr.SetSource (image);
+                cr.Paint ();
 
-            cr.Rectangle (0, image.Height, image.Width, reflect);
-            cr.Clip ();
+                cr.Rectangle (0, image.Height, image.Width, reflect);
+                cr.Clip ();
 
-            Matrix matrix = new Matrix ();
-            matrix.InitScale (1, -1);
-            matrix.Translate (0, -(2 * image.Height) + 1);
-            cr.Transform (matrix);
+                Matrix matrix = new Matrix ();
+                matrix.InitScale (1, -1);
+                matrix.Translate (0, -(2 * image.Height) + 1);
+                cr.Transform (matrix);
 
-            cr.SetSource (image);
-            cr.Paint ();
+                cr.SetSource (image);
+                cr.Paint ();
 
-            cr.Restore ();
+                cr.Restore ();
 
-            Color bg_transparent = BackgroundColor;
-            bg_transparent.A = 0.65;
+                Color bg_transparent = BackgroundColor;
+                bg_transparent.A = 0.65;
 
-            LinearGradient mask = new LinearGradient (0, image.Height, 0, image.Height + reflect);
-            mask.AddColorStop (0, bg_transparent);
-            mask.AddColorStop (1, BackgroundColor);
+                using (LinearGradient mask = new LinearGradient (0, image.Height, 0, image.Height + reflect)) {
+                    mask.AddColorStop (0, bg_transparent);
+                    mask.AddColorStop (1, BackgroundColor);
 
-            cr.Rectangle (0, image.Height, image.Width, reflect);
-            cr.Pattern = mask;
-            cr.Fill ();
+                    cr.Rectangle (0, image.Height, image.Width, reflect);
+                    cr.SetSource (mask);
+                    cr.Fill ();
+                }
 
-            ((IDisposable)cr).Dispose ();
+            }
             return surface;
         }
 
@@ -254,7 +256,7 @@ namespace Banshee.Gui.Widgets
 
             if (render_track) {
                 cr.MoveTo (track_info_alloc.X, track_info_alloc.Y);
-                cr.Color = TextColor;
+                cr.SetSourceColor (TextColor);
                 PangoCairoHelper.ShowLayout (cr, first_line_layout);
 
                 RenderTrackRating (cr, track);
diff -up banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs.cairofix banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
--- banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs.cairofix	2014-02-18 15:40:14.000000000 -0500
+++ banshee-2.6.2/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs	2017-07-18 13:36:34.006318533 -0400
@@ -269,9 +269,9 @@ namespace Banshee.Sources.Gui
             // Draw the count
             if (!hide_count) {
                 if (view != null && view.Cr != null) {
-                    view.Cr.Color = state == StateType.Normal || (view != null && state == StateType.Prelight)
+                    view.Cr.SetSourceColor (state == StateType.Normal || (view != null && state == StateType.Prelight)
                         ? view.Theme.TextMidColor
-                        : view.Theme.Colors.GetWidgetColor (GtkColorClass.Text, state);
+                        : view.Theme.Colors.GetWidgetColor (GtkColorClass.Text, state));
 
                     view.Cr.MoveTo (
                         cell_area.X + cell_area.Width - count_layout_width - 2,
diff -up banshee-2.6.2/src/Core/Banshee.Widgets/Banshee.Widgets/DiscUsageDisplay.cs.cairofix banshee-2.6.2/src/Core/Banshee.Widgets/Banshee.Widgets/DiscUsageDisplay.cs
--- banshee-2.6.2/src/Core/Banshee.Widgets/Banshee.Widgets/DiscUsageDisplay.cs.cairofix	2014-02-18 15:40:14.000000000 -0500
+++ banshee-2.6.2/src/Core/Banshee.Widgets/Banshee.Widgets/DiscUsageDisplay.cs	2017-07-18 13:36:34.006318533 -0400
@@ -128,13 +128,13 @@ namespace Banshee.Widgets
             cr.LineWidth = base_line_width / 1.5;
 
             cr.Arc(x, y, radius, 0, 2 * Math.PI);
-            cr.Pattern = bg_gradient;
+            cr.SetSource (bg_gradient);
             cr.Fill();
 
             /*cr.LineTo(x, y);
             cr.Arc(x, y, radius, a1 + 2 * Math.PI * 0.92, a1);
             cr.LineTo(x, y);
-            cr.Pattern = bound_gradient;
+            cr.SetSource (bound_gradient);
             cr.Fill();
             cr.Stroke();*/
 
@@ -150,28 +150,28 @@ namespace Banshee.Widgets
                 cr.Pattern = Fraction >= 1.0 ? fg_gradient_full : fg_gradient;
                 cr.FillPreserve();
 
-                cr.Color = stroke_color;
+                cr.SetSourceColor (stroke_color);
                 cr.Stroke();
             }
 
             cr.Arc(x, y, radius / 2.75, 0, 2 * Math.PI);
-            cr.Color = fill_color_c;
+            cr.SetSourceColor (fill_color_c);
             cr.FillPreserve();
-            cr.Color = new Cairo.Color(1, 1, 1, 0.75);
+            cr.SetSourceColor (new Cairo.Color(1, 1, 1, 0.75));
             cr.FillPreserve();
 
             cr.LineWidth = base_line_width / 1.5;
 
-            cr.Color = stroke_color;
+            cr.SetSourceColor (stroke_color);
             cr.Stroke();
 
             cr.Arc(x, y, radius / 5.5, 0, 2 * Math.PI);
-            cr.Color = fill_color_c;
+            cr.SetSourceColor (fill_color_c);
             cr.FillPreserve();
 
             cr.LineWidth = base_line_width / 2;
 
-            cr.Color = inner_stroke_color;
+            cr.SetSourceColor (inner_stroke_color);
             cr.Stroke();
 
             cr.Arc(x, y, radius, 0, 2 * Math.PI);
@@ -180,11 +180,11 @@ namespace Banshee.Widgets
             if(Capacity <= 0) {
                 // this sucks balls
                 cr.Rectangle(0, 0, Allocation.Width, Allocation.Height);
-                cr.Color = text_bg_color;
+                cr.SetSourceColor (text_bg_color);
                 cr.FillPreserve();
 
                 cr.SelectFontFace("Sans", FontSlant.Normal, FontWeight.Bold);
-                cr.Color = text_color;
+                cr.SetSourceColor (text_color);
                 cr.SetFontSize(Allocation.Width * 0.2);
                 DrawText(cr, Mono.Unix.Catalog.GetString("Insert\nDisc"), 3);
             }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs	2017-07-18 13:36:34.007318509 -0400
@@ -112,7 +112,7 @@ namespace Hyena.Data.Gui
             Cairo.Color color = context.Theme.Colors.GetWidgetColor (
                 context.TextAsForeground ? GtkColorClass.Foreground : GtkColorClass.Text, context.State);
             color.A = Alpha ?? (context.Opaque ? 1.0 : 0.5);
-            context.Context.Color = color;
+            context.Context.SetSourceColor (color);
 
             PangoCairoHelper.ShowLayout (context.Context, context.Layout);
             //context.Context.ResetClip ();
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs	2017-07-18 13:36:34.007318509 -0400
@@ -235,7 +235,7 @@ namespace Hyena.Data.Gui
                     GtkColorClass.Base, StateType.Normal), 0.0);
                 stroke_color.A = 0.3;
 
-                cairo_context.Color = stroke_color;
+                cairo_context.SetSourceColor (stroke_color);
                 cairo_context.MoveTo (area.X + 0.5, area.Y + 1.0);
                 cairo_context.LineTo (area.X + 0.5, area.Bottom);
                 cairo_context.MoveTo (area.Right - 0.5, area.Y + 1.0);
@@ -390,7 +390,7 @@ namespace Hyena.Data.Gui
                 cairo_context.Antialias = Cairo.Antialias.None;
                 cairo_context.MoveTo (single_list_alloc.Left, single_list_alloc.Top);
                 cairo_context.LineTo (single_list_alloc.Right, single_list_alloc.Top);
-                cairo_context.Color = Theme.Colors.GetWidgetColor (GtkColorClass.Text, StateType.Normal);
+                cairo_context.SetSourceColor (Theme.Colors.GetWidgetColor (GtkColorClass.Text, StateType.Normal));
                 cairo_context.Stroke ();
                 cairo_context.Restore ();
             }
@@ -448,7 +448,7 @@ namespace Hyena.Data.Gui
             if (dragging) {
                 Cairo.Color fill_color = Theme.Colors.GetWidgetColor (GtkColorClass.Base, StateType.Normal);
                 fill_color.A = 0.5;
-                cairo_context.Color = fill_color;
+                cairo_context.SetSourceColor (fill_color);
                 cairo_context.Rectangle (area.X, area.Y, area.Width, area.Height);
                 cairo_context.Fill ();
             }
@@ -483,7 +483,7 @@ namespace Hyena.Data.Gui
 
             cairo_context.Rectangle (x, header_rendering_alloc.Bottom + 1, column.Width - 2,
                 list_rendering_alloc.Bottom - header_rendering_alloc.Bottom - 1);
-            cairo_context.Color = fill_color;
+            cairo_context.SetSourceColor (fill_color);
             cairo_context.Fill ();
 
             cairo_context.MoveTo (x - 0.5, header_rendering_alloc.Bottom + 0.5);
@@ -491,7 +491,7 @@ namespace Hyena.Data.Gui
             cairo_context.LineTo (x + column.Width - 1.5, list_rendering_alloc.Bottom + 0.5);
             cairo_context.LineTo (x + column.Width - 1.5, header_rendering_alloc.Bottom + 0.5);
 
-            cairo_context.Color = stroke_color;
+            cairo_context.SetSourceColor (stroke_color);
             cairo_context.LineWidth = 1.0;
             cairo_context.Stroke ();
         }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ListViewTestModule.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ListViewTestModule.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ListViewTestModule.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Data.Gui/ListViewTestModule.cs	2017-07-18 13:36:34.007318509 -0400
@@ -240,7 +240,7 @@ namespace Hyena.Data.Gui.Tests
             red = !red;
             Cairo.Context cr = context.Context;
             cr.Rectangle (0, 0, cellWidth, cellHeight);
-            cr.Color = CairoExtensions.RgbaToColor (red ? 0xff000099 : 0x00000099);
+            cr.SetSourceColor (CairoExtensions.RgbaToColor (red ? 0xff000099 : 0x00000099));
             cr.Fill ();
 
             List<Gdk.Point> points = Points;
@@ -252,7 +252,7 @@ namespace Hyena.Data.Gui.Tests
                 }
             }
 
-            cr.Color = CairoExtensions.RgbToColor ((uint)random.Next (0xffffff));
+            cr.SetSourceColor (CairoExtensions.RgbToColor ((uint)random.Next (0xffffff)));
             cr.LineWidth = 1;
             cr.Stroke ();
         }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/CairoDamageDebugger.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/CairoDamageDebugger.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/CairoDamageDebugger.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/CairoDamageDebugger.cs	2017-07-18 13:36:34.007318509 -0400
@@ -49,7 +49,7 @@ namespace Hyena.Gui
         {
             cr.Save ();
             cr.LineWidth = 1.0;
-            cr.Color = CairoExtensions.RgbToColor ((uint)rand.Next (0, 0xffffff));
+            cr.SetSourceColor (CairoExtensions.RgbToColor ((uint)rand.Next (0, 0xffffff)));
             cr.Rectangle (x + 0.5, y + 0.5, w - 1, h - 1);
             cr.Stroke ();
             cr.Restore ();
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/CairoExtensions.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/CairoExtensions.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/CairoExtensions.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/CairoExtensions.cs	2017-07-18 13:36:34.007318509 -0400
@@ -65,13 +65,17 @@ namespace Hyena.Gui
             return layout;
         }
 
-        public static Surface CreateSurfaceForPixbuf (Cairo.Context cr, Gdk.Pixbuf pixbuf)
+        public static Surface CreateSurfaceForPixbuf (Context cr, Pixbuf pixbuf)
         {
-            Surface surface = cr.Target.CreateSimilar (cr.Target.Content, pixbuf.Width, pixbuf.Height);
-            Cairo.Context surface_cr = new Context (surface);
-            Gdk.CairoHelper.SetSourcePixbuf (surface_cr, pixbuf, 0, 0);
-            surface_cr.Paint ();
-            ((IDisposable)surface_cr).Dispose ();
+            Surface surface;
+            using (var t = cr.GetTarget ()) {
+                surface = t.CreateSimilar (t.Content, pixbuf.Width, pixbuf.Height);
+            }
+            using (Context surface_cr = new Context (surface)) {
+                CairoHelper.SetSourcePixbuf (surface_cr, pixbuf, 0, 0);
+                surface_cr.Paint ();
+                surface_cr.Dispose ();
+            }
             return surface;
         }
 
@@ -319,8 +323,7 @@ namespace Hyena.Gui
 
         public static void DisposeContext (Cairo.Context cr)
         {
-            ((IDisposable)cr.Target).Dispose ();
-            ((IDisposable)cr).Dispose ();
+            cr.Dispose ();
         }
 
         private struct CairoInteropCall
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Brush.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Brush.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Brush.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Brush.cs	2017-07-18 13:36:34.007318509 -0400
@@ -64,7 +64,7 @@ namespace Hyena.Gui.Canvas
 
         public virtual void Apply (Cairo.Context cr)
         {
-            cr.Color = color;
+            cr.SetSourceColor (color);
         }
 
         public static readonly Brush Black = new Brush (0.0, 0.0, 0.0);
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/CanvasHost.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/CanvasHost.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/CanvasHost.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/CanvasHost.cs	2017-07-18 13:36:34.007318509 -0400
@@ -150,8 +150,7 @@ namespace Hyena.Gui.Canvas
 
                 if (Debug) {
                     cr.LineWidth = 1.0;
-                    cr.Color = CairoExtensions.RgbToColor (
-                        (uint)(rand = rand ?? new Random ()).Next (0, 0xffffff));
+                    cr.SetSourceColor (CairoExtensions.RgbToColor ((uint)(rand = rand ?? new Random ()).Next (0, 0xffffff)));
                     cr.Rectangle (damage.X + 0.5, damage.Y + 0.5, damage.Width - 1, damage.Height - 1);
                     cr.Stroke ();
                 }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Prelight.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Prelight.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Prelight.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Prelight.cs	2017-07-18 13:36:34.008318485 -0400
@@ -41,13 +41,13 @@ namespace Hyena.Gui.Canvas
 
             var x = rect.Width / 2.0;
             var y = rect.Height / 2.0;
-            var grad = new Cairo.RadialGradient (x, y, 0, x, y, rect.Width / 2.0);
-            grad.AddColorStop (0, new Cairo.Color (0, 0, 0, 0.1 * opacity));
-            grad.AddColorStop (1, new Cairo.Color (0, 0, 0, 0.35 * opacity));
-            cr.Pattern = grad;
-            CairoExtensions.RoundedRectangle (cr, rect.X, rect.Y, rect.Width, rect.Height, theme.Context.Radius);
-            cr.Fill ();
-            grad.Destroy ();
+            using (var grad = new Cairo.RadialGradient (x, y, 0, x, y, rect.Width / 2.0)) {
+                grad.AddColorStop (0, new Cairo.Color (0, 0, 0, 0.1 * opacity));
+                grad.AddColorStop (1, new Cairo.Color (0, 0, 0, 0.35 * opacity));
+                cr.SetSource (grad);
+                CairoExtensions.RoundedRectangle (cr, rect.X, rect.Y, rect.Width, rect.Height, theme.Context.Radius);
+                cr.Fill ();
+            }
 
             cr.Restore ();
         }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/ShadowMarginStyle.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/ShadowMarginStyle.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/ShadowMarginStyle.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/ShadowMarginStyle.cs	2017-07-18 13:36:34.008318485 -0400
@@ -66,7 +66,7 @@ namespace Hyena.Gui.Canvas
                     steps - i);
 
                 color.A = opacity_step * (i + 1);
-                cr.Color = color;
+                cr.SetSourceColor (color);
                 cr.Stroke ();
             }
         }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Slider.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Slider.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Slider.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/Slider.cs	2017-07-18 13:36:34.008318485 -0400
@@ -153,7 +153,7 @@ namespace Hyena.Gui.Canvas
             double throbber_y = (Allocation.Height - ThrobberSize) / 2.0 - Margin.Top + throbber_r;
             double bar_w = RenderSize.Width * Value;
 
-            cr.Color = Theme.Colors.GetWidgetColor (GtkColorClass.Base, Gtk.StateType.Normal);
+            cr.SetSourceColor (Theme.Colors.GetWidgetColor (GtkColorClass.Base, Gtk.StateType.Normal));
             cr.Rectangle (0, 0, RenderSize.Width, RenderSize.Height);
             cr.Fill ();
 
@@ -169,10 +169,10 @@ namespace Hyena.Gui.Canvas
             fill.AddColorStop (1, light_fill_color);
 
             cr.Rectangle (0, 0, bar_w, RenderSize.Height);
-            cr.Pattern = fill;
+            cr.SetSource (fill);
             cr.Fill ();
 
-            cr.Color = fill_color;
+            cr.SetSourceColor (fill_color);
             cr.Arc (throbber_x, throbber_y, throbber_r, 0, Math.PI * 2);
             cr.Fill ();
         }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/TestTile.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/TestTile.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/TestTile.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/TestTile.cs	2017-07-18 13:36:34.008318485 -0400
@@ -55,7 +55,7 @@ namespace Hyena.Gui.Canvas
             }
 
             CairoExtensions.RoundedRectangle (cr, 0, 0, RenderSize.Width, RenderSize.Height, 5);
-            cr.Color = color;
+            cr.SetSourceColor (color);
             cr.Fill ();
         }
     }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Canvas/TextBlock.cs	2017-07-18 13:36:34.008318485 -0400
@@ -217,7 +217,7 @@ namespace Hyena.Gui.Canvas
 
                 cr.PopGroupToSource ();
                 cr.Mask (mask);
-                mask.Destroy ();
+                mask.Dispose ();
             }
 
             cr.ResetClip ();
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/RatingRenderer.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/RatingRenderer.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/RatingRenderer.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/RatingRenderer.cs	2017-07-18 13:36:34.008318485 -0400
@@ -93,13 +93,13 @@ namespace Hyena.Gui
 
                 if (fill || hover_fill) {
                     if (!isHovering || hoverValue >= Value) {
-                        cr.Color = fill ? fill_color : hover_fill_color;
+                        cr.SetSourceColor (fill ? fill_color : hover_fill_color);
                     } else {
-                        cr.Color = hover_fill ? fill_color : hover_fill_color;
+                        cr.SetSourceColor (hover_fill ? fill_color : hover_fill_color);
                     }
                     cr.Fill ();
                 } else {
-                    cr.Color = stroke_color;
+                    cr.SetSourceColor (stroke_color);
                     cr.Stroke ();
                 }
             }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/ShadingTestWindow.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/ShadingTestWindow.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/ShadingTestWindow.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui/ShadingTestWindow.cs	2017-07-18 13:36:34.008318485 -0400
@@ -58,7 +58,7 @@ namespace Hyena.Gui
                     double y = Allocation.Y + yi * step_height;
 
                     cr.Rectangle (x, y, step_width, step_height);
-                    cr.Color = CairoExtensions.ColorFromHsb (h, s, bg_b);
+                    cr.SetSourceColor (CairoExtensions.ColorFromHsb (h, s, bg_b));
                     cr.Fill ();
 
                     int tw, th;
@@ -68,7 +68,7 @@ namespace Hyena.Gui
 
                     cr.Translate (0.5, 0.5);
                     cr.MoveTo (x + (step_width - tw) / 2.0, y + (step_height - th) / 2.0);
-                    cr.Color = CairoExtensions.ColorFromHsb (h, s, fg_b);
+                    cr.SetSourceColor (CairoExtensions.ColorFromHsb (h, s, fg_b));
                     PangoCairoHelper.ShowLayout (cr, layout);
                     cr.Translate (-0.5, -0.5);
                 }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs	2017-07-18 13:38:09.979993771 -0400
@@ -87,17 +87,15 @@ namespace Hyena.Gui.Theming
             Color color_a = Colors.GetWidgetColor (GtkColorClass.Background, StateType.Selected);
             Color color_b = CairoExtensions.ColorShade (color_a, 1.4);
 
-            RadialGradient fill = new RadialGradient (Context.X, Context.Y, 0,
-                Context.X, Context.Y, 2.0 * Context.Radius);
-            fill.AddColorStop (0, color_a);
-            fill.AddColorStop (1, color_b);
-            Context.Cairo.Pattern = fill;
-
-            Context.Cairo.FillPreserve ();
-            fill.Destroy ();
+            using (RadialGradient fill = new RadialGradient (Context.X, Context.Y, 0, Context.X, Context.Y, 2.0 * Context.Radius)) {
+                fill.AddColorStop (0, color_a);
+                fill.AddColorStop (1, color_b);
+                Context.Cairo.SetSource (fill);
+                Context.Cairo.FillPreserve ();
+            }
 
             // Stroke the pie
-            Context.Cairo.Color = CairoExtensions.ColorShade (color_a, 0.8);
+            Context.Cairo.SetSourceColor (CairoExtensions.ColorShade (color_a, 0.8));
             Context.Cairo.LineWidth = Context.LineWidth;
             Context.Cairo.Stroke ();
         }
@@ -134,9 +132,9 @@ namespace Hyena.Gui.Theming
             cr.LineTo (x3, y2);
             cr.LineTo (x1, y1);
 
-            cr.Color = Colors.GetWidgetColor (GtkColorClass.Base, StateType.Normal);
+            cr.SetSourceColor (Colors.GetWidgetColor (GtkColorClass.Base, StateType.Normal));
             cr.FillPreserve ();
-            cr.Color = Colors.GetWidgetColor (GtkColorClass.Text, StateType.Normal);
+            cr.SetSourceColor (Colors.GetWidgetColor (GtkColorClass.Text, StateType.Normal));
             cr.Stroke ();
 
             cr.Translate (-dx, -dy);
@@ -152,9 +150,9 @@ namespace Hyena.Gui.Theming
         {
             color.A = Context.FillAlpha;
             if (pattern != null) {
-                cr.Pattern = pattern;
+                cr.SetSource (pattern);
             } else {
-                cr.Color = color;
+                cr.SetSourceColor (color);
             }
             CairoExtensions.RoundedRectangle (cr, alloc.X, alloc.Y, alloc.Width, alloc.Height, Context.Radius, CairoCorners.All);
             cr.Fill ();
@@ -193,10 +191,10 @@ namespace Hyena.Gui.Theming
             // FIXME Windows; shading the color by .8 makes it blend into the bg
             if (Widget.HasFocus && !Hyena.PlatformDetection.IsWindows) {
                 cr.LineWidth = BorderWidth * 1.5;
-                cr.Color = CairoExtensions.ColorShade (border_color, 0.8);
+                cr.SetSourceColor (CairoExtensions.ColorShade (border_color, 0.8));
             } else {
                 cr.LineWidth = BorderWidth;
-                cr.Color = border_color;
+                cr.SetSourceColor (border_color);
             }
 
             double offset = (double)cr.LineWidth / 2.0;
@@ -217,14 +215,13 @@ namespace Hyena.Gui.Theming
             Cairo.Color light_color = CairoExtensions.ColorShade (color, 1.6);
             Cairo.Color dark_color = CairoExtensions.ColorShade (color, 1.3);
 
-            LinearGradient grad = new LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Bottom - 1);
-            grad.AddColorStop (0, light_color);
-            grad.AddColorStop (1, dark_color);
-
-            cr.Pattern = grad;
-            cr.Rectangle (alloc.X + 1.5, alloc.Y + 1.5, alloc.Width - 3, alloc.Height - 2);
-            cr.Fill ();
-            grad.Destroy ();
+            using (LinearGradient grad = new LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Bottom - 1)) {
+                grad.AddColorStop (0, light_color);
+                grad.AddColorStop (1, dark_color);
+                cr.SetSource (grad);
+                cr.Rectangle (alloc.X + 1.5, alloc.Y + 1.5, alloc.Width - 3, alloc.Height - 2);
+                cr.Fill ();
+            }
         }
 
         public override void DrawHeaderBackground (Cairo.Context cr, Gdk.Rectangle alloc)
@@ -235,19 +232,18 @@ namespace Hyena.Gui.Theming
 
             CairoCorners corners = CairoCorners.TopLeft | CairoCorners.TopRight;
 
-            LinearGradient grad = new LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Bottom);
-            grad.AddColorStop (0, light_color);
-            grad.AddColorStop (0.75, dark_color);
-            grad.AddColorStop (0, light_color);
-
-            cr.Pattern = grad;
-            CairoExtensions.RoundedRectangle (cr, alloc.X, alloc.Y, alloc.Width, alloc.Height, Context.Radius, corners);
-            cr.Fill ();
+            using (LinearGradient grad = new LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Bottom)) {
+                grad.AddColorStop (0, light_color);
+                grad.AddColorStop (0.75, dark_color);
+                grad.AddColorStop (0, light_color);
+                cr.SetSource (grad);
+                CairoExtensions.RoundedRectangle (cr, alloc.X, alloc.Y, alloc.Width, alloc.Height, Context.Radius, corners);
+                cr.Fill ();
+            }
 
-            cr.Color = border_color;
+            cr.SetSourceColor (border_color);
             cr.Rectangle (alloc.X, alloc.Bottom, alloc.Width, BorderWidth);
             cr.Fill ();
-            grad.Destroy ();
         }
 
         public override void DrawColumnHeaderFocus (Cairo.Context cr, Gdk.Rectangle alloc)
@@ -262,7 +258,7 @@ namespace Hyena.Gui.Theming
                 Colors.GetWidgetColor (GtkColorClass.Background, StateType.Selected), 0.8);
 
             stroke_color.A = 0.1;
-            cr.Color = stroke_color;
+            cr.SetSourceColor (stroke_color);
 
             CairoExtensions.RoundedRectangle (cr,
                 alloc.X + margin + line_width + right_offset,
@@ -275,7 +271,7 @@ namespace Hyena.Gui.Theming
 
             stroke_color.A = 1.0;
             cr.LineWidth = line_width;
-            cr.Color = stroke_color;
+            cr.SetSourceColor (stroke_color);
             CairoExtensions.RoundedRectangle (cr,
                 alloc.X + margin + line_width + right_offset,
                 alloc.Y + margin + line_width + top_offset,
@@ -297,12 +293,12 @@ namespace Hyena.Gui.Theming
             cr.LineWidth = 1;
             cr.Antialias = Cairo.Antialias.None;
 
-            cr.Color = dark_color;
+            cr.SetSourceColor (dark_color);
             cr.MoveTo (x, y_1);
             cr.LineTo (x, y_2);
             cr.Stroke ();
 
-            cr.Color = light_color;
+            cr.SetSourceColor (light_color);
             cr.MoveTo (x + 1, y_1);
             cr.LineTo (x + 1, y_2);
             cr.Stroke ();
@@ -313,7 +309,7 @@ namespace Hyena.Gui.Theming
         public override void DrawListBackground (Context cr, Gdk.Rectangle alloc, Color color)
         {
             color.A = Context.FillAlpha;
-            cr.Color = color;
+            cr.SetSourceColor (color);
             cr.Rectangle (alloc.X, alloc.Y, alloc.Width, alloc.Height);
             cr.Fill ();
         }
@@ -322,7 +318,7 @@ namespace Hyena.Gui.Theming
                                             Cairo.Color color, CairoCorners corners)
         {
             cr.LineWidth = 1.25;
-            cr.Color = color;
+            cr.SetSourceColor (color);
             CairoExtensions.RoundedRectangle (cr, x + cr.LineWidth/2.0, y + cr.LineWidth/2.0,
                 width - cr.LineWidth, height - cr.LineWidth, Context.Radius, corners, true);
             cr.Stroke ();
@@ -342,11 +338,10 @@ namespace Hyena.Gui.Theming
             Cairo.Color selection_stroke = CairoExtensions.ColorShade (selection_color, 0.85);
             selection_highlight.A = 0.5;
             selection_stroke.A = color.A;
-            LinearGradient grad = null;
 
             if (filled) {
                 if (flat_fill) {
-                    cr.Color = selection_color;
+                    cr.SetSourceColor (selection_color);
                 } else {
                     Cairo.Color selection_fill_light = CairoExtensions.ColorShade (selection_color, 1.12);
                     Cairo.Color selection_fill_dark = selection_color;
@@ -354,25 +349,22 @@ namespace Hyena.Gui.Theming
                     selection_fill_light.A = color.A;
                     selection_fill_dark.A = color.A;
 
-                    grad = new LinearGradient (x, y, x, y + height);
-                    grad.AddColorStop (0, selection_fill_light);
-                    grad.AddColorStop (0.4, selection_fill_dark);
-                    grad.AddColorStop (1, selection_fill_light);
-
-                    cr.Pattern = grad;
+                    using (LinearGradient grad = new LinearGradient (x, y, x, y + height)) {
+                        grad.AddColorStop (0, selection_fill_light);
+                        grad.AddColorStop (0.4, selection_fill_dark);
+                        grad.AddColorStop (1, selection_fill_light);
+                        cr.SetSource (grad);
+                    }
                 }
 
                 CairoExtensions.RoundedRectangle (cr, x, y, width, height, Context.Radius, corners, true);
                 cr.Fill ();
 
-                if (grad != null) {
-                    grad.Destroy ();
-                }
             }
 
             if (filled && stroked) {
                 cr.LineWidth = 1.0;
-                cr.Color = selection_highlight;
+                cr.SetSourceColor (selection_highlight);
                 CairoExtensions.RoundedRectangle (cr, x + 1.5, y + 1.5, width - 3, height - 3,
                     Context.Radius - 1, corners, true);
                 cr.Stroke ();
@@ -380,7 +372,7 @@ namespace Hyena.Gui.Theming
 
             if (stroked) {
                 cr.LineWidth = 1.0;
-                cr.Color = selection_stroke;
+                cr.SetSourceColor (selection_stroke);
                 CairoExtensions.RoundedRectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1,
                     Context.Radius, corners, true);
                 cr.Stroke ();
@@ -389,7 +381,7 @@ namespace Hyena.Gui.Theming
 
         public override void DrawRowRule (Cairo.Context cr, int x, int y, int width, int height)
         {
-            cr.Color = new Cairo.Color (rule_color.R, rule_color.G, rule_color.B, Context.FillAlpha);
+            cr.SetSourceRGBA (rule_color.R, rule_color.G, rule_color.B, Context.FillAlpha);
             cr.Rectangle (x, y, width, height);
             cr.Fill ();
         }
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Widgets/PulsingButton.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Widgets/PulsingButton.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Widgets/PulsingButton.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Widgets/PulsingButton.cs	2017-07-18 13:36:34.009318461 -0400
@@ -96,17 +96,17 @@ namespace Hyena.Widgets
             double alpha = Choreographer.Compose (pulsator.Percent, Easing.Sine);
 
             Cairo.Color color = CairoExtensions.GdkColorToCairoColor (Style.Background (StateType.Selected));
-            Cairo.RadialGradient fill = new Cairo.RadialGradient (x, y, 0, x, y, r);
-            color.A = alpha;
-            fill.AddColorStop (0, color);
-            fill.AddColorStop (0.5, color);
-            color.A = 0;
-            fill.AddColorStop (1, color);
+            using (Cairo.RadialGradient fill = new Cairo.RadialGradient (x, y, 0, x, y, r)) {
+                color.A = alpha;
+                fill.AddColorStop (0, color);
+                fill.AddColorStop (0.5, color);
+                color.A = 0;
+                fill.AddColorStop (1, color);
 
-            cr.Arc (x, y, r, 0, 2 * Math.PI);
-            cr.Pattern = fill;
-            cr.Fill ();
-            fill.Destroy ();
+                cr.Arc (x, y, r, 0, 2 * Math.PI);
+                cr.SetSource (fill);
+                cr.Fill ();
+            }
 
             CairoExtensions.DisposeContext (cr);
             return base.OnExposeEvent (evnt);
diff -up banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs.cairofix banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs
--- banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs.cairofix	2014-02-18 15:40:26.000000000 -0500
+++ banshee-2.6.2/src/Hyena/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs	2017-07-18 13:36:34.009318461 -0400
@@ -330,50 +330,48 @@ namespace Hyena.Widgets
                 bar_height + bar_label_spacing + layout_height));
             cr.Clip ();
 
-            Pattern bar = RenderBar (Allocation.Width - 2 * h_padding, bar_height);
-
-            cr.Save ();
-            cr.Source = bar;
-            cr.Paint ();
-            cr.Restore ();
-
-            if (reflect) {
+            using (Pattern bar = RenderBar (Allocation.Width - 2 * h_padding, bar_height)) {
                 cr.Save ();
+                cr.SetSource (bar);
+                cr.Paint ();
+                cr.Restore ();
 
-                cr.Rectangle (0, bar_height, Allocation.Width - h_padding, bar_height);
-                cr.Clip ();
+                if (reflect) {
+                    cr.Save ();
 
-                Matrix matrix = new Matrix ();
-                matrix.InitScale (1, -1);
-                matrix.Translate (0, -(2 * bar_height) + 1);
-                cr.Transform (matrix);
+                    cr.Rectangle (0, bar_height, Allocation.Width - h_padding, bar_height);
+                    cr.Clip ();
 
-                cr.Pattern = bar;
+                    Matrix matrix = new Matrix ();
+                    matrix.InitScale (1, -1);
+                    matrix.Translate (0, -(2 * bar_height) + 1);
+                    cr.Transform (matrix);
 
-                LinearGradient mask = new LinearGradient (0, 0, 0, bar_height);
+                    cr.SetSource (bar);
 
-                mask.AddColorStop (0.25, new Color (0, 0, 0, 0));
-                mask.AddColorStop (0.5, new Color (0, 0, 0, 0.125));
-                mask.AddColorStop (0.75, new Color (0, 0, 0, 0.4));
-                mask.AddColorStop (1.0, new Color (0, 0, 0, 0.7));
+                    using (LinearGradient mask = new LinearGradient (0, 0, 0, bar_height)) {
+                        mask.AddColorStop (0.25, new Color (0, 0, 0, 0));
+                        mask.AddColorStop (0.5, new Color (0, 0, 0, 0.125));
+                        mask.AddColorStop (0.75, new Color (0, 0, 0, 0.4));
+                        mask.AddColorStop (1.0, new Color (0, 0, 0, 0.7));
 
-                cr.Mask (mask);
-                mask.Destroy ();
+                        cr.Mask (mask);
+                    }
 
-                cr.Restore ();
+                    cr.Restore ();
 
-                CairoExtensions.PopGroupToSource (cr);
-                cr.Paint ();
-            }
+                    CairoExtensions.PopGroupToSource (cr);
+                    cr.Paint ();
+                }
 
-            if (show_labels) {
-                cr.Translate ((reflect ? Allocation.X : -h_padding) + (Allocation.Width - layout_width) / 2,
-                     (reflect ? Allocation.Y : 0) + bar_height + bar_label_spacing);
+                if (show_labels) {
+                    cr.Translate ((reflect ? Allocation.X : -h_padding) + (Allocation.Width - layout_width) / 2,
+                         (reflect ? Allocation.Y : 0) + bar_height + bar_label_spacing);
 
-                RenderLabels (cr);
-            }
+                    RenderLabels (cr);
+                }
 
-            bar.Destroy ();
+            }
             CairoExtensions.DisposeContext (cr);
 
             return true;
@@ -401,29 +399,29 @@ namespace Hyena.Widgets
 
         private void RenderBarSegments (Context cr, int w, int h, int r)
         {
-            LinearGradient grad = new LinearGradient (0, 0, w, 0);
-            double last = 0.0;
+            using (LinearGradient grad = new LinearGradient (0, 0, w, 0)) {
+                double last = 0.0;
 
-            foreach (Segment segment in segments) {
-                if (segment.Percent > 0) {
-                    grad.AddColorStop (last, segment.Color);
-                    grad.AddColorStop (last += segment.Percent, segment.Color);
+                foreach (Segment segment in segments) {
+                    if (segment.Percent > 0) {
+                        grad.AddColorStop (last, segment.Color);
+                        grad.AddColorStop (last += segment.Percent, segment.Color);
+                    }
                 }
+
+                CairoExtensions.RoundedRectangle (cr, 0, 0, w, h, r);
+                cr.SetSource (grad);
+                cr.FillPreserve ();
             }
 
-            CairoExtensions.RoundedRectangle (cr, 0, 0, w, h, r);
-            cr.Pattern = grad;
-            cr.FillPreserve ();
-            cr.Pattern.Destroy ();
-
-            grad = new LinearGradient (0, 0, 0, h);
-            grad.AddColorStop (0.0, new Color (1, 1, 1, 0.125));
-            grad.AddColorStop (0.35, new Color (1, 1, 1, 0.255));
-            grad.AddColorStop (1, new Color (0, 0, 0, 0.4));
-
-            cr.Pattern = grad;
-            cr.Fill ();
-            cr.Pattern.Destroy ();
+            using (LinearGradient grad = new LinearGradient (0, 0, 0, h)) {
+                grad.AddColorStop (0.0, new Color (1, 1, 1, 0.125));
+                grad.AddColorStop (0.35, new Color (1, 1, 1, 0.255));
+                grad.AddColorStop (1, new Color (0, 0, 0, 0.4));
+
+                cr.SetSource (grad);
+                cr.Fill ();
+            }
         }
 
         private void RenderBarStrokes (Context cr, int w, int h, int r)
@@ -440,24 +438,24 @@ namespace Hyena.Widgets
             while (x <= w - r) {
                 cr.MoveTo (x - 0.5, 1);
                 cr.LineTo (x - 0.5, h - 1);
-                cr.Pattern = seg_sep_light;
+                cr.SetSource (seg_sep_light);
                 cr.Stroke ();
 
                 cr.MoveTo (x + 0.5, 1);
                 cr.LineTo (x + 0.5, h - 1);
-                cr.Pattern = seg_sep_dark;
+                cr.SetSource (seg_sep_dark);
                 cr.Stroke ();
 
                 x += seg_w;
             }
 
             CairoExtensions.RoundedRectangle (cr, 0.5, 0.5, w - 1, h - 1, r);
-            cr.Pattern = stroke;
+            cr.SetSource (stroke);
             cr.Stroke ();
 
-            stroke.Destroy ();
-            seg_sep_light.Destroy ();
-            seg_sep_dark.Destroy ();
+            stroke.Dispose ();
+            seg_sep_light.Dispose ();
+            seg_sep_dark.Dispose ();
         }
 
         private LinearGradient MakeSegmentGradient (int h, Color color)
@@ -489,12 +487,12 @@ namespace Hyena.Widgets
             foreach (Segment segment in segments) {
                 cr.LineWidth = 1;
                 cr.Rectangle (x + 0.5, 2 + 0.5, segment_box_size - 1, segment_box_size - 1);
-                LinearGradient grad = MakeSegmentGradient (segment_box_size, segment.Color, true);
-                cr.Pattern = grad;
-                cr.FillPreserve ();
-                cr.Color = box_stroke_color;
-                cr.Stroke ();
-                grad.Destroy ();
+                using (LinearGradient grad = MakeSegmentGradient (segment_box_size, segment.Color, true)) {
+                    cr.SetSource (grad);
+                    cr.FillPreserve ();
+                    cr.SetSourceColor (box_stroke_color);
+                    cr.Stroke ();
+                }
 
                 x += segment_box_size + segment_box_spacing;
 
@@ -505,7 +503,7 @@ namespace Hyena.Widgets
 
                 cr.MoveTo (x, 0);
                 text_color.A = 0.9;
-                cr.Color = text_color;
+                cr.SetSourceColor (text_color);
                 PangoCairoHelper.ShowLayout (cr, layout);
                 cr.Fill ();
 
@@ -514,7 +512,7 @@ namespace Hyena.Widgets
 
                 cr.MoveTo (x, lh);
                 text_color.A = 0.75;
-                cr.Color = text_color;
+                cr.SetSourceColor (text_color);
                 PangoCairoHelper.ShowLayout (cr, layout);
                 cr.Fill ();