diff --git a/src/support/ui.rs b/src/support/ui.rs index c802632a3..337595415 100644 --- a/src/support/ui.rs +++ b/src/support/ui.rs @@ -3,29 +3,12 @@ use errors::*; use gdk_pixbuf; -use gdk_pixbuf_sys; -use glib::translate::FromGlibPtrFull; -use glib::translate::ToGlibPtr; use gtk::prelude::*; use gtk; use std::path::*; -/// Copy a `Pixbuf` explicitly, since they don't implement the `Copy` trait. -/// Currently does not call `gdk_pixbuf_copy_options()`. -pub fn copy_pixbuf(pixbuf: &gdk_pixbuf::Pixbuf) -> gdk_pixbuf::Pixbuf { - - let new_pixbuf = unsafe { - let gdk_pixbuf = pixbuf.to_glib_none().0; - let copy = gdk_pixbuf_sys::gdk_pixbuf_copy(gdk_pixbuf); - FromGlibPtrFull::from_glib_full(copy) - }; - - return new_pixbuf; -} - - /// Get a pixbuf by name from the given theme with the requested size. /// Note that the size is not enforced, but rather a hint. pub fn pixbuf_new_from_theme( diff --git a/src/ui/tray_icon.rs b/src/ui/tray_icon.rs index 39a77a508..e29a2c670 100644 --- a/src/ui/tray_icon.rs +++ b/src/ui/tray_icon.rs @@ -222,7 +222,7 @@ impl VolMeter { let i_width = pixbuf.get_width() as i64; let i_height = pixbuf.get_height() as i64; - let new_pixbuf = copy_pixbuf(pixbuf); + let new_pixbuf = pixbuf.copy(); let vm_width = i_width / 6; let x = (self.x_offset_pct as f64 *