From 4cc6c0d19edc5e7a946158de768a2a3bd9f039a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 27 Aug 2020 09:49:03 +0300 Subject: [PATCH] Use glib::timeout_add_local() instead of removed gtk::timeout_add() --- examples/src/bin/gtksink.rs | 2 +- examples/src/bin/gtkvideooverlay.rs | 2 +- tutorials/src/bin/basic-tutorial-5.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/src/bin/gtksink.rs b/examples/src/bin/gtksink.rs index f2c6ffc23..36414b2df 100644 --- a/examples/src/bin/gtksink.rs +++ b/examples/src/bin/gtksink.rs @@ -84,7 +84,7 @@ fn create_ui(app: >k::Application) { // the underlying pipeline, and display it in our gui. // Since this closure is called by the mainloop thread, we are allowed // to modify the gui widgets here. - let timeout_id = gtk::timeout_add(500, move || { + let timeout_id = glib::timeout_add_local(500, move || { // Here we temporarily retrieve a strong reference on the pipeline from the weak one // we moved into this callback. let pipeline = match pipeline_weak.upgrade() { diff --git a/examples/src/bin/gtkvideooverlay.rs b/examples/src/bin/gtkvideooverlay.rs index 395f1b8e8..e42936d14 100644 --- a/examples/src/bin/gtkvideooverlay.rs +++ b/examples/src/bin/gtkvideooverlay.rs @@ -195,7 +195,7 @@ fn create_ui(app: >k::Application) { // the underlying pipeline, and display it in our gui. // Since this closure is called by the mainloop thread, we are allowed // to modify the gui widgets here. - let timeout_id = gtk::timeout_add(500, move || { + let timeout_id = glib::timeout_add_local(500, move || { // Here we temporarily retrieve a strong reference on the pipeline from the weak one // we moved into this callback. let pipeline = match pipeline_weak.upgrade() { diff --git a/tutorials/src/bin/basic-tutorial-5.rs b/tutorials/src/bin/basic-tutorial-5.rs index 5595b883b..812d79bfa 100644 --- a/tutorials/src/bin/basic-tutorial-5.rs +++ b/tutorials/src/bin/basic-tutorial-5.rs @@ -167,7 +167,7 @@ mod tutorial5 { let pipeline = playbin.clone(); let lslider = slider.clone(); // Update the UI (seekbar) every second - let timeout_id = gtk::timeout_add_seconds(1, move || { + let timeout_id = glib::timeout_add_seconds_local(1, move || { let pipeline = &pipeline; let lslider = &lslider;