From b4f80f39dfacdea8321214047f491314dcdb791d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E9=94=8B?= Date: Tue, 10 Feb 2026 19:32:03 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(app-window):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20Linux=20Mint=20=E7=AA=97=E5=8F=A3=E4=BB=85=E5=B7=A6?= =?UTF-8?q?=E4=B8=8A=E8=A7=92=E5=8F=AF=E7=BC=A9=E6=94=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 增加 Linux 运行时识别并启用专用缩放命中层 - 补齐四边四角 app-region: drag 热区 - Linux 下禁用外层 clipPath 裁切以避免边缘命中异常 --- frontend/src/App.tsx | 50 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index de91ad8..7172ecc 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import { Layout, Button, ConfigProvider, theme, Dropdown, MenuProps, message, Modal, Spin, Slider, Progress } from 'antd'; import zhCN from 'antd/locale/zh_CN'; import { PlusOutlined, BulbOutlined, BulbFilled, ConsoleSqlOutlined, UploadOutlined, DownloadOutlined, CloudDownloadOutlined, BugOutlined, ToolOutlined, InfoCircleOutlined, GithubOutlined, SkinOutlined, CheckOutlined, MinusOutlined, BorderOutlined, CloseOutlined, SettingOutlined } from '@ant-design/icons'; -import { EventsOn } from '../wailsjs/runtime/runtime'; +import { Environment, EventsOn } from '../wailsjs/runtime/runtime'; import Sidebar from './components/Sidebar'; import TabManager from './components/TabManager'; import ConnectionModal from './components/ConnectionModal'; @@ -29,6 +29,7 @@ function App() { const effectiveBlur = normalizeBlurForPlatform(appearance.blur); const blurFilter = blurToFilter(effectiveBlur); const windowCornerRadius = 14; + const [isLinuxRuntime, setIsLinuxRuntime] = useState(false); // 同步 macOS 窗口透明度:opacity=1.0 且 blur=0 时关闭 NSVisualEffectView, // 避免 GPU 持续计算窗口背后的模糊合成 @@ -36,6 +37,23 @@ function App() { SetWindowTranslucency(appearance.opacity, appearance.blur).catch(() => {}); }, [appearance.opacity, appearance.blur]); + useEffect(() => { + let cancelled = false; + Environment() + .then((env) => { + if (cancelled) return; + setIsLinuxRuntime((env?.platform || '').toLowerCase() === 'linux'); + }) + .catch(() => { + if (cancelled) return; + const platform = typeof navigator !== 'undefined' ? navigator.platform : ''; + setIsLinuxRuntime(/linux/i.test(platform)); + }); + return () => { + cancelled = true; + }; + }, []); + // Background Helper const getBg = (darkHex: string, lightHex: string) => { if (!darkMode) return `rgba(255, 255, 255, ${effectiveOpacity})`; // Light mode usually white @@ -550,6 +568,17 @@ function App() { }; }, []); + const linuxResizeHandleStyleBase = { + position: 'fixed', + zIndex: 12000, + background: 'transparent', + WebkitAppRegion: 'drag', + '--wails-draggable': 'drag', + userSelect: 'none' + } as any; + + const showLinuxResizeHandles = isLinuxRuntime; + return ( @@ -891,6 +920,21 @@ function App() { ) : null} + + {showLinuxResizeHandles && ( + <> + {/* Linux Mint 下 frameless 仅局部可缩放:补四边四角命中层 */} +
+
+
+
+ +
+
+
+
+ + )} {/* Ghost Resize Line for Sidebar */}