mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-23 02:26:35 +00:00
gtk4: Attach main context receiver from the main context's thread
Otherwise it will fail if the sink's state is changed from a different thread. See https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio/-/issues/2
This commit is contained in:
parent
7c872bb92b
commit
858865b731
1 changed files with 9 additions and 9 deletions
|
@ -65,23 +65,23 @@ impl PaintableSink {
|
|||
// created.
|
||||
let (send, recv) = mpsc::channel();
|
||||
context.invoke(glib::clone!(
|
||||
@weak self as s =>
|
||||
@weak self as sink =>
|
||||
move || {
|
||||
let paintable = Fragile::new(SinkPaintable::new());
|
||||
send.send(paintable).expect("Somehow we dropped the receiver");
|
||||
|
||||
receiver.attach(
|
||||
None,
|
||||
glib::clone!(
|
||||
@weak sink => @default-return glib::Continue(false),
|
||||
move |action| sink.do_action(action)
|
||||
),
|
||||
);
|
||||
}
|
||||
));
|
||||
|
||||
let paintable = recv.recv().expect("Somehow we dropped the sender");
|
||||
|
||||
receiver.attach(
|
||||
None,
|
||||
glib::clone!(
|
||||
@weak self as sink => @default-return glib::Continue(false),
|
||||
move |action| sink.do_action(action)
|
||||
),
|
||||
);
|
||||
|
||||
**paintable_storage = Some(paintable);
|
||||
|
||||
let imp = self.imp();
|
||||
|
|
Loading…
Reference in a new issue