aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/main.rs b/src/main.rs
index 2081584..64dfdba 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -199,14 +199,15 @@ impl WallpaperApp {
Ok(())
}
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>) {
- if new_size.width > 0 && new_size.height > 0
+ 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);
- }
+ {
+ config.width = new_size.width;
+ config.height = new_size.height;
+ surface.configure(device, config);
+ }
}
fn render(&mut self) -> Result<()> {
let surface = self
@@ -323,16 +324,16 @@ impl ApplicationHandler for WallpaperApp {
WindowEvent::RedrawRequested => {
// Apply Hyprland rules on first redraw (after window is mapped)
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) =
- wayland::apply_hyprland_rules(window_id, &self.hyprland_config)
- {
- warn!("Failed to apply Hyprland rules: {}", e);
- }
- self.wayland_configured = true;
+ && let Some(window) = &self.window
+ {
+ // Convert window ID to u64 for hyprctl
+ let window_id: u64 = window.id().into();
+ if let Err(e) = wayland::apply_hyprland_rules(window_id, &self.hyprland_config)
+ {
+ warn!("Failed to apply Hyprland rules: {}", e);
}
+ self.wayland_configured = true;
+ }
if let Err(e) = self.render() {
error!("Render error: {}", e);
event_loop.exit();
@@ -364,7 +365,7 @@ fn main() -> Result<()> {
let shader_path = matches
.get_one::<String>("shader")
.map(|s| s.as_str())
- .unwrap_or("shaders/default.wgsl")
+ .unwrap_or("shaders/red.wgsl")
.to_string();
run_wallpaper(shader_path)?;
Ok(())
@@ -375,4 +376,3 @@ fn run_wallpaper(shader_path: String) -> Result<()> {
event_loop.run_app(&mut app)?;
Ok(())
}
-