From c3afc414a3029ced7bd7145c8908545f4c95997b Mon Sep 17 00:00:00 2001 From: NimBold Date: Sat, 5 Sep 2026 20:54:13 +0330 Subject: [PATCH] fix(window): harden frame geometry across window states - Remove rounded renderer corners from opaque Linux window surfaces. - Track maximized state with race-safe native reads for main and Properties windows. - Flatten maximized Windows frames without changing macOS AppKit zoom contours. - Make early platform detection explicit, testable, and fail closed on unsupported targets. --- src/App.tsx | 4 +- src/components/PropertiesWindowApp.tsx | 4 ++ src/index.css | 13 ++++ src/main.tsx | 11 +++- src/utils/platform.test.ts | 35 ++++++++-- src/utils/platform.ts | 23 ++++--- src/utils/windowMaximized.test.ts | 88 +++++++++++++++++++++++++ src/utils/windowMaximized.ts | 91 ++++++++++++++++++++++++++ 8 files changed, 252 insertions(+), 17 deletions(-) create mode 100644 src/utils/windowMaximized.test.ts create mode 100644 src/utils/windowMaximized.ts diff --git a/src/App.tsx b/src/App.tsx index edcf200..f69b054 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -57,6 +57,7 @@ import { } from './utils/schedulerControl'; import { createSerialTaskQueue } from './utils/serialTaskQueue'; import { useWindowFocusState } from './utils/windowFocus'; +import { useWindowMaximizedState } from './utils/windowMaximized'; const loadSettingsView = () => import('./components/SettingsView'); const loadSchedulerView = () => import('./components/SchedulerView'); @@ -189,6 +190,7 @@ function App() { const { i18n, t } = useTranslation(); const platform = usePlatformInfo(); const isWindowActive = useWindowFocusState(); + const isWindowMaximized = useWindowMaximizedState(); const [filter, setFilter] = useState('all'); const [downloadTableSummary, setDownloadTableSummary] = useState(null); const [coreReady, setCoreReady] = useState(false); @@ -1222,7 +1224,7 @@ function App() { }, [autoAddClipboardLinks, coreReady, showKeychainModal]); return ( -
{ const { t } = useTranslation(); const isWindowActive = useWindowFocusState(); + const isWindowMaximized = useWindowMaximizedState(); const translationRef = useRef(t); translationRef.current = t; const currentWindow = useMemo(() => getCurrentWindow(), []); @@ -1138,6 +1140,7 @@ export const PropertiesWindowApp = () => { className={windowShellClassName} style={windowShellStyle} data-window-active={isWindowActive ? 'true' : 'false'} + data-window-maximized={isWindowMaximized ? 'true' : 'false'} aria-labelledby="properties-window-title" > @@ -1253,6 +1256,7 @@ export const PropertiesWindowApp = () => { className={windowShellClassName} style={windowShellStyle} data-window-active={isWindowActive ? 'true' : 'false'} + data-window-maximized={isWindowMaximized ? 'true' : 'false'} aria-labelledby="properties-window-title" > diff --git a/src/index.css b/src/index.css index 1f239ea..85a5ec5 100644 --- a/src/index.css +++ b/src/index.css @@ -2373,6 +2373,19 @@ html[data-list-density="relaxed"] { border-width: 0.5px; } + /* Linux uses an opaque GTK/WebKit surface, so renderer-only curves would + expose square native backing pixels. Maximized Windows surfaces likewise + need to meet the work area instead of leaving transparent corner cutouts. + macOS zoomed windows retain their native rounded AppKit contour. */ + html[data-platform="linux"] :is(.app-shell, .properties-window-shell), + html[data-platform="windows"] :is(.app-shell, .properties-window-shell)[data-window-maximized="true"] { + border-radius: 0; + } + + html[data-platform="windows"] :is(.app-shell, .properties-window-shell)[data-window-maximized="true"] { + border-color: transparent; + } + @media (forced-colors: active) { .app-shell, .properties-window-shell { diff --git a/src/main.tsx b/src/main.tsx index 0f5eece..e7243f7 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -14,7 +14,10 @@ import { error as logError, warn as logWarn, initLogger } from "./utils/logger"; import { getCurrentWindow } from '@tauri-apps/api/window'; import { invokeCommand as invoke } from './ipc'; import { useWindowFocusState } from './utils/windowFocus'; -import './utils/platform'; +import { syncPlatformDatasetFromUserAgent } from './utils/platform'; +import { useWindowMaximizedState } from './utils/windowMaximized'; + +syncPlatformDatasetFromUserAgent(navigator.userAgent); const isPropertiesWindow = getCurrentWindow().label.startsWith('properties-'); @@ -86,8 +89,9 @@ const renderRoot = (RootComponent: ComponentType) => { const PropertiesStartupFailure = () => { const isWindowActive = useWindowFocusState(); + const isWindowMaximized = useWindowMaximizedState(); return ( -
+

Download Properties could not be loaded.