gtk4: Use a correctly typed None value when retrieving the paintable property fails

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/609

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1850>
This commit is contained in:
Sebastian Dröge 2024-10-14 18:22:04 +03:00
parent 5e49f1d10e
commit 628dee9079

View file

@ -140,7 +140,7 @@ impl ObjectImpl for PaintableSink {
// GtkBin was dropped for GTK4 https://gitlab.gnome.org/GNOME/gtk/-/commit/3c165b3b77
if glib::types::Type::from_name("GtkBin").is_some() {
gst::error!(CAT, imp = self, "Skipping the creation of paintable to avoid segfault between GTK3 and GTK4");
return None::<&gdk::Paintable>.to_value();
return None::<&Paintable>.to_value();
}
let mut paintable_guard = self.paintable.lock().unwrap();
@ -154,7 +154,7 @@ impl ObjectImpl for PaintableSink {
Some(ref paintable) => paintable,
None => {
gst::error!(CAT, imp = self, "Failed to create paintable");
return None::<&gdk::Paintable>.to_value();
return None::<&Paintable>.to_value();
}
};
@ -165,7 +165,7 @@ impl ObjectImpl for PaintableSink {
imp = self,
"Can't retrieve Paintable from non-main thread"
);
return None::<&gdk::Paintable>.to_value();
return None::<&Paintable>.to_value();
}
let paintable = paintable.get_ref().clone();