Skip to content

Commit

Permalink
Update gtk lib
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-lemay committed Oct 31, 2023
1 parent 3d8c1a8 commit b419065
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 66 deletions.
108 changes: 49 additions & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions f1-telemetry-display/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ log = "^0.4"
simplelog = "0.12.0"
time = "0.3.11"
ncurses = { version = "5.101", features = ["wide"] }
gtk = "0.17.1"
gio = "0.17.9"
glib = "0.17.9"
gdk = "0.17.1"
cairo-rs = { version = "0.17.0", features = ["png"] }
gtk = "0.18.1"
gio = "0.18.2"
glib = "0.18.2"
gdk = "0.18.0"
cairo-rs = { version = "0.18.2", features = ["png"] }
5 changes: 3 additions & 2 deletions f1-telemetry-display/src/ui/gtk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::rc::Rc;

use async_trait::async_trait;
use gio::prelude::*;
use glib::ControlFlow;
use gtk::prelude::*;

use f1_telemetry::packet::Packet;
Expand Down Expand Up @@ -73,7 +74,7 @@ impl Ui for GtkUi {
let game_state = RefCell::new(GameState::default());
let widgets = Rc::new(Widgets::new(app));

let (tx, rx) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);
let (tx, rx) = glib::MainContext::channel(glib::Priority::DEFAULT);

tokio::spawn(async move {
while let Some(p) = crate::CHANNEL.rx.write().await.recv().await {
Expand All @@ -84,7 +85,7 @@ impl Ui for GtkUi {
rx.attach(None, move |packet| {
process_packet(&game_state, &widgets, &packet);

Continue(true)
ControlFlow::Continue
});
});

Expand Down

0 comments on commit b419065

Please sign in to comment.