From d50c00afb4a56a82f1234fbeabaf30c886ea4142 Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Thu, 9 Apr 2026 16:23:45 +0100 Subject: [PATCH] revert: remove debouncing and transparent window from zoom fix Reverted debouncing logic and transparent window mode that were causing issues. Kept the zoom step reduction from 0.2 to 0.1 for finer control. --- packages/tauri-app/src-tauri/src/main.rs | 13 +------------ packages/tauri-app/src-tauri/tauri.conf.json | 1 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/tauri-app/src-tauri/src/main.rs b/packages/tauri-app/src-tauri/src/main.rs index 82d631c2..47a91b17 100644 --- a/packages/tauri-app/src-tauri/src/main.rs +++ b/packages/tauri-app/src-tauri/src/main.rs @@ -9,7 +9,7 @@ use serde_json::json; use std::collections::HashMap; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Mutex; -use std::time::{Instant, SystemTime, UNIX_EPOCH}; +use std::time::{SystemTime, UNIX_EPOCH}; use tauri::menu::{MenuBuilder, MenuItem, SubmenuBuilder}; use tauri::plugin::{Builder as PluginBuilder, TauriPlugin}; use tauri::webview::Webview; @@ -32,12 +32,10 @@ use std::os::windows::ffi::OsStrExt; use windows_sys::Win32::UI::Shell::SetCurrentProcessExplicitAppUserModelID; static QUIT_REQUESTED: AtomicBool = AtomicBool::new(false); -static LAST_ZOOM_TIME: Mutex> = Mutex::new(None); const DEFAULT_ZOOM_LEVEL: f64 = 1.0; const ZOOM_STEP: f64 = 0.1; const MIN_ZOOM_LEVEL: f64 = 0.2; const MAX_ZOOM_LEVEL: f64 = 5.0; -const ZOOM_DEBOUNCE_MS: u64 = 50; #[cfg(windows)] const WINDOWS_APP_USER_MODEL_ID: &str = "ai.neuralnomads.codenomad.client"; @@ -259,15 +257,6 @@ fn clamp_zoom_level(value: f64) -> f64 { } fn set_main_window_zoom(app_handle: &AppHandle, next_zoom: f64) { - if let Ok(mut last_zoom_time) = LAST_ZOOM_TIME.lock() { - if let Some(last_time) = *last_zoom_time { - if last_time.elapsed().as_millis() < ZOOM_DEBOUNCE_MS as u128 { - return; - } - } - *last_zoom_time = Some(Instant::now()); - } - if let Some(window) = app_handle.get_webview_window("main") { let normalized = clamp_zoom_level(next_zoom); if window.set_zoom(normalized).is_ok() { diff --git a/packages/tauri-app/src-tauri/tauri.conf.json b/packages/tauri-app/src-tauri/tauri.conf.json index 9b1d256d..8a1b4103 100644 --- a/packages/tauri-app/src-tauri/tauri.conf.json +++ b/packages/tauri-app/src-tauri/tauri.conf.json @@ -23,7 +23,6 @@ "resizable": true, "fullscreen": false, "decorations": true, - "transparent": true, "theme": "Dark", "backgroundColor": "#1a1a1a", "zoomHotkeysEnabled": true