Update all dependencies

This commit is contained in:
2024-08-02 11:21:48 -07:00
parent d0df73a9c7
commit 4ed974335e
23 changed files with 947 additions and 790 deletions

View File

@ -7,12 +7,18 @@ edition = "2021"
anyhow = "1"
bscreensaver-util = { path = "../util" }
chrono = "0.4"
gethostname = "0.2"
glib = { version = "0.15", features = ["log"] }
gtk = "0.15"
gtk-sys = "0.15"
gdk-sys = "0.15"
gdkx11 = "0.15"
gethostname = "0.4"
glib = { version = "0.18", features = ["log"] }
gtk = "0.18"
gtk-sys = "0.18"
gdk-sys = "0.18"
gdkx11 = "0.18"
log = "0.4"
pam-client = "0.5"
shell-words = "1"
[build-dependencies]
# pam-sys specifies default-features = false, which drops the 'runtime'
# feature; this ends up conflicting with the xkbcommon-sys build in another
# module, which causes pam-sys to fail to build
bindgen = { version = "0.69", features = ["runtime"] }

View File

@ -1,7 +1,7 @@
use chrono::prelude::*;
use gdkx11::X11Window;
use gethostname::gethostname;
use glib::{GString, clone};
use glib::{ControlFlow, GString, clone};
use gtk::{prelude::*, Button, Entry, Label, Plug, Window};
use log::{debug, error, warn};
use std::{io::{self, Write}, sync::mpsc, thread, time::Duration, ffi::CString};
@ -215,7 +215,7 @@ fn main() -> anyhow::Result<()> {
vbox.pack_start(&label, false, false, 0);
glib::timeout_add_seconds_local(1, move || {
set_time_label(&label);
glib::Continue(true)
ControlFlow::Continue
});
let sep = gtk::Separator::builder()
@ -275,19 +275,19 @@ fn main() -> anyhow::Result<()> {
.build();
top_vbox.pack_end(&timer, false, false, 0);
let delta = (DIALOG_UPDATE_INTERVAL.as_millis() as f64) / (DIALOG_TIMEOUT.as_millis() as f64);
glib::timeout_add_local(DIALOG_UPDATE_INTERVAL, clone!(@weak timer => @default-return Continue(false), move || {
glib::timeout_add_local(DIALOG_UPDATE_INTERVAL, clone!(@weak timer => @default-return ControlFlow::Break, move || {
let new_fraction = timer.fraction() - delta;
if new_fraction <= 0.0 {
DialogExitStatus::AuthTimedOut.exit();
}
timer.set_fraction(new_fraction);
Continue(true)
ControlFlow::Continue
}));
let (tx, rx) = glib::MainContext::channel(glib::Priority::default());
let username = bscreensaver_util::get_username()?;
rx.attach(None, clone!(@weak dialog, @weak auth_vbox, @weak accept_button_box, @weak timer, @strong username, => @default-return glib::Continue(false), move |op| {
rx.attach(None, clone!(@weak dialog, @weak auth_vbox, @weak accept_button_box, @weak timer, @strong username, => @default-return ControlFlow::Break, move |op| {
for child in auth_vbox.children() {
auth_vbox.remove(&child);
}
@ -366,7 +366,7 @@ fn main() -> anyhow::Result<()> {
if ev.keyval().name() == Some(GString::from("Escape")) {
DialogExitStatus::AuthCanceled.exit();
}
gtk::Inhibit(false)
glib::Propagation::Stop
}));
input_box.grab_focus();
@ -388,7 +388,7 @@ fn main() -> anyhow::Result<()> {
};
dialog.show_all();
glib::Continue(true)
ControlFlow::Continue
}));
thread::spawn(move || {