Skip to content

Commit

Permalink
Version 0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
LGFae committed Mar 23, 2024
1 parent 9c58d6e commit ad22bbf
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 30 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
### Unreleased


### 0.9.0-master
### 0.9.1

My bad everyone, `0.9.0` wasn't loading the cache, so I am publishing this quick
fix.

### 0.9.0

Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default-members = [".", "daemon"]

[package]
name = "swww"
version = "0.9.0-master"
version = "0.9.1"
authors = ["Leonardo Gibrowski Faé <leonardo.fae44@gmail.com>"]
edition = "2021"
rust-version = "1.74"
Expand Down Expand Up @@ -34,7 +34,7 @@ image = "0.25"
fast_image_resize = "3.0"
clap = { version = "4.5", features = ["derive", "wrap_help", "env"] }
rand = "0.8"
utils = { version = "0.9.0-master", path = "utils" }
utils = { version = "0.9.1", path = "utils" }

[dev-dependencies]
assert_cmd = "2.0"
Expand Down
4 changes: 2 additions & 2 deletions daemon/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "swww-daemon"
version = "0.9.0-master"
version = "0.9.1"
authors = ["Leonardo Gibrowski Faé <leonardo.fae44@gmail.com>"]
edition = "2021"

Expand All @@ -21,6 +21,6 @@ spin_sleep = "1.2"

sd-notify = { version = "0.4.1" }

utils = { version = "0.9.0-master", path = "../utils" }
utils = { version = "0.9.1", path = "../utils" }
[dev-dependencies]
rand = "0.8"
36 changes: 15 additions & 21 deletions daemon/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ struct Daemon {
// swww stuff
wallpapers: Vec<Arc<Wallpaper>>,
animator: Animator,
initializing: bool,
}

impl Daemon {
Expand Down Expand Up @@ -305,7 +304,6 @@ impl Daemon {

wallpapers: Vec::new(),
animator: Animator::new(),
initializing: true,
}
}

Expand All @@ -328,7 +326,6 @@ impl Daemon {
self.animator.animate(bytes, wallpapers)
}
ArchivedRequest::Clear(clear) => {
self.initializing = false;
let wallpapers = self.find_wallpapers_by_names(&clear.outputs);
let color = clear.color;
match std::thread::Builder::new()
Expand Down Expand Up @@ -360,7 +357,6 @@ impl Daemon {
}
ArchivedRequest::Query => Answer::Info(self.wallpapers_info()),
ArchivedRequest::Img((_, imgs)) => {
self.initializing = false;
let mut used_wallpapers = Vec::new();
for img in imgs.iter() {
let mut wallpapers = self.find_wallpapers_by_names(&img.1);
Expand Down Expand Up @@ -500,23 +496,21 @@ impl OutputHandler for Daemon {
Some(&output),
);

if !self.initializing {
if let Some(name) = &output_info.name {
let name = name.to_owned();
if let Err(e) = std::thread::Builder::new()
.name("cache loader".to_string())
.stack_size(1 << 14)
.spawn(move || {
// Wait for a bit for the output to be properly configured and stuff
// this is obviously not ideal, but it solves the vast majority of problems
std::thread::sleep(std::time::Duration::from_millis(100));
if let Err(e) = utils::cache::load(&name) {
warn!("failed to load cache: {e}");
}
})
{
warn!("failed to spawn `cache loader` thread: {e}");
}
if let Some(name) = &output_info.name {
let name = name.to_owned();
if let Err(e) = std::thread::Builder::new()
.name("cache loader".to_string())
.stack_size(1 << 14)
.spawn(move || {
// Wait for a bit for the output to be properly configured and stuff
// this is obviously not ideal, but it solves the vast majority of problems
std::thread::sleep(std::time::Duration::from_millis(100));
if let Err(e) = utils::cache::load(&name) {
warn!("failed to load cache: {e}");
}
})
{
warn!("failed to spawn `cache loader` thread: {e}");
}
}

Expand Down
2 changes: 1 addition & 1 deletion utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "utils"
version = "0.9.0-master"
version = "0.9.1"
authors = ["Leonardo Gibrowski Faé <leonardo.fae44@gmail.com>"]
edition = "2021"
license-file = "../LICENSE"
Expand Down

0 comments on commit ad22bbf

Please sign in to comment.