aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2025-10-18 15:00:01 +0300
committerPetri Hienonen <petri.hienonen@gmail.com>2025-10-18 15:00:01 +0300
commit1dd8bd776c516d122cb849c1c681a6bdbff30b06 (patch)
tree053a6ad4bb6d04ae8e9c6223d96e177e0617f288 /src
parent72dec2b9a86e78f16f14e7c19ec1d5c6bd0879e6 (diff)
downloadwallpaper-1dd8bd776c516d122cb849c1c681a6bdbff30b06.tar.zst
Fixes
Diffstat (limited to 'src')
-rw-r--r--src/main.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 49993a6..2081584 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -199,15 +199,14 @@ impl WallpaperApp {
Ok(())
}
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>) {
- if new_size.width > 0 && new_size.height > 0 {
- if let (Some(surface), Some(device), Some(config)) =
+ if new_size.width > 0 && new_size.height > 0
+ && let (Some(surface), Some(device), Some(config)) =
(&self.surface, &self.device, &mut self.config)
{
config.width = new_size.width;
config.height = new_size.height;
surface.configure(device, config);
}
- }
}
fn render(&mut self) -> Result<()> {
let surface = self
@@ -323,8 +322,8 @@ impl ApplicationHandler for WallpaperApp {
}
WindowEvent::RedrawRequested => {
// Apply Hyprland rules on first redraw (after window is mapped)
- if !self.wayland_configured {
- if let Some(window) = &self.window {
+ if !self.wayland_configured
+ && let Some(window) = &self.window {
// Convert window ID to u64 for hyprctl
let window_id: u64 = window.id().into();
if let Err(e) =
@@ -334,7 +333,6 @@ impl ApplicationHandler for WallpaperApp {
}
self.wayland_configured = true;
}
- }
if let Err(e) = self.render() {
error!("Render error: {}", e);
event_loop.exit();