From 050bf5cbacfefb7020fec7561a637a3c1c71de04 Mon Sep 17 00:00:00 2001 From: "Brian J. Tarricone" Date: Thu, 5 May 2022 14:50:51 -0700 Subject: [PATCH] Support more versions of glib and gtk --- Cargo.lock | 2 +- dialog-gtk3/Cargo.toml | 4 ++-- dialog-gtk3/src/main.rs | 2 +- settings/Cargo.toml | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 40bceb5..d1d087a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -317,7 +317,6 @@ dependencies = [ "bscreensaver-util", "glib", "gtk", - "log", ] [[package]] @@ -839,6 +838,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", + "log", "once_cell", "smallvec", "thiserror", diff --git a/dialog-gtk3/Cargo.toml b/dialog-gtk3/Cargo.toml index e91b1dd..40d820e 100644 --- a/dialog-gtk3/Cargo.toml +++ b/dialog-gtk3/Cargo.toml @@ -8,8 +8,8 @@ anyhow = "1" bscreensaver-util = { path = "../util" } chrono = "0.4" gethostname = "0.2" -glib = { version = "0.15", features = ["v2_68"] } -gtk = { version = "0.15", features = ["v3_24"] } +glib = { version = "0.15", features = ["log"] } +gtk = "0.15" gtk-sys = "0.15" gdk-sys = "0.15" gdkx11 = "0.15" diff --git a/dialog-gtk3/src/main.rs b/dialog-gtk3/src/main.rs index 734e21b..3706e8a 100644 --- a/dialog-gtk3/src/main.rs +++ b/dialog-gtk3/src/main.rs @@ -13,6 +13,7 @@ const DIALOG_TIMEOUT: Duration = Duration::from_secs(60); fn main() -> anyhow::Result<()> { init_logging("BSCREENSAVER_DIALOG_GTK3_LOG"); + glib::log_set_default_handler(glib::rust_log_handler); let mut config = Configuration::load()?; let new_login_command = config.new_login_command @@ -22,7 +23,6 @@ fn main() -> anyhow::Result<()> { let standalone = std::env::var("BSCREENSAVER_DIALOG_STANDALONE").is_ok(); - unsafe { glib::log_writer_default_set_use_stderr(true) }; gtk::init()?; let top_sg = gtk::SizeGroup::builder() diff --git a/settings/Cargo.toml b/settings/Cargo.toml index a3af124..dadbca1 100644 --- a/settings/Cargo.toml +++ b/settings/Cargo.toml @@ -6,6 +6,5 @@ edition = "2021" [dependencies] anyhow = "1" bscreensaver-util = { path = "../util" } -glib = { version = "0.15", features = ["v2_68"] } -gtk = { version = "0.15", features = ["v3_24"] } -log = "0.4" +glib = "0.15" +gtk = { version = "0.15", features = ["v3_20"] }