aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/main.vala10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/main.vala b/lib/main.vala
index 27fae8e7..52f7ab8b 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -48,8 +48,6 @@ public class Indicator.Keyboard.Service : Object {
const int H = 20;
const double R = 2.0;
- Icon icon = null;
-
Pango.FontDescription description;
var style = get_style_context ();
var colour = style.get_color (Gtk.StateFlags.NORMAL);
@@ -82,12 +80,14 @@ public class Indicator.Keyboard.Service : Object {
Pango.cairo_layout_path (context, layout);
context.fill ();
+ var buffer = new ByteArray ();
+
surface.write_to_png_stream ((data) => {
- icon = new BytesIcon (new Bytes (data));
- return icon != null ? Cairo.Status.SUCCESS : Cairo.Status.NULL_POINTER;
+ buffer.append (data);
+ return Cairo.Status.SUCCESS;
});
- return icon;
+ return new BytesIcon (ByteArray.free_to_bytes ((owned) buffer));
}
[DBus (visible = false)]