fix(app): backport rendering improvements (#1580)

This commit is contained in:
Hampus
2026-08-13 19:52:00 +02:00
committed by GitHub
parent 0c291a01da
commit 42cdc1f877
513 changed files with 98743 additions and 70397 deletions
+7 -7
View File
@@ -53,11 +53,11 @@ const VOICE_POPOUT_WINDOW_NAME_LENGTH_MAX = 256;
const VOICE_POPOUT_MIN_WIDTH = 360;
const VOICE_POPOUT_MIN_HEIGHT = 240;
const VOICE_POPOUT_WINDOWS_MAX = 8;
const VOICE_POPOUT_TITLEBAR_HEIGHT_MAC = 28;
const VOICE_POPOUT_TRAFFIC_LIGHT_DIAMETER = 14;
const VOICE_POPOUT_TRAFFIC_LIGHT_POSITION = {
const CUSTOM_TITLEBAR_HEIGHT_MAC = 32;
const CUSTOM_TITLEBAR_TRAFFIC_LIGHT_DIAMETER = 14;
const CUSTOM_TITLEBAR_TRAFFIC_LIGHT_POSITION = {
x: 12,
y: Math.round((VOICE_POPOUT_TITLEBAR_HEIGHT_MAC - VOICE_POPOUT_TRAFFIC_LIGHT_DIAMETER) / 2),
y: Math.round((CUSTOM_TITLEBAR_HEIGHT_MAC - CUSTOM_TITLEBAR_TRAFFIC_LIGHT_DIAMETER) / 2),
};
const trustedWebOrigins = new Set(
[STABLE_APP_URL, CANARY_APP_URL]
@@ -664,7 +664,7 @@ function getVoicePopoutWindowOptions(): Electron.BrowserWindowConstructorOptions
...getTitleBarWindowOptions(getActiveUseNativeTitleBar()),
minWidth: VOICE_POPOUT_MIN_WIDTH,
minHeight: VOICE_POPOUT_MIN_HEIGHT,
trafficLightPosition: isMac ? VOICE_POPOUT_TRAFFIC_LIGHT_POSITION : undefined,
trafficLightPosition: isMac ? CUSTOM_TITLEBAR_TRAFFIC_LIGHT_POSITION : undefined,
backgroundColor: getWindowBackgroundColor(false),
transparent: false,
hasShadow: getWindowHasShadow(false),
@@ -745,7 +745,7 @@ export function createWindow(options: CreateWindowOptions = {}): BrowserWindow {
transparent: allowTransparency,
hasShadow: getWindowHasShadow(allowTransparency),
...getTitleBarWindowOptions(useNativeTitleBar),
trafficLightPosition: isMac ? {x: 9, y: 9} : undefined,
trafficLightPosition: isMac ? CUSTOM_TITLEBAR_TRAFFIC_LIGHT_POSITION : undefined,
acceptFirstMouse: acceptFirstMouseOnFocus,
webPreferences: getSharedWebPreferences(allowTransparency, useNativeTitleBar, appUrl),
};
@@ -1070,7 +1070,7 @@ export function createWindow(options: CreateWindowOptions = {}): BrowserWindow {
title: isThemeStudioPopout ? THEME_STUDIO_POPOUT_TITLE : undefined,
minWidth: isThemeStudioPopout ? THEME_STUDIO_POPOUT_MIN_WIDTH : undefined,
minHeight: isThemeStudioPopout ? THEME_STUDIO_POPOUT_MIN_HEIGHT : undefined,
trafficLightPosition: isMac ? {x: 12, y: 5} : undefined,
trafficLightPosition: isMac ? CUSTOM_TITLEBAR_TRAFFIC_LIGHT_POSITION : undefined,
backgroundColor: getWindowBackgroundColor(allowPopoutTransparency),
transparent: allowPopoutTransparency,
hasShadow: getWindowHasShadow(allowPopoutTransparency),
+2 -1
View File
@@ -86,6 +86,7 @@ const ACTIVE_USE_NATIVE_TITLEBAR_RENDERER_ARG = '--fluxer-active-use-native-titl
const CUSTOM_TITLEBAR_HEIGHT = '32px';
const NATIVE_TITLEBAR_HEIGHT = '0px';
const STARTUP_NATIVE_TITLEBAR_ID = 'fluxer-startup-native-titlebar';
const THEME_STUDIO_STANDALONE_PATHNAME = '/theme-studio';
const ZOOM_LEVEL_MIN = 0.5;
const ZOOM_LEVEL_MAX = 2.0;
@@ -299,7 +300,7 @@ function getStartupPlatformClass(): string {
}
function installStartupNativeTitlebar(activeUseNativeTitleBar: boolean): void {
if (process.platform === 'darwin' || activeUseNativeTitleBar) return;
if (activeUseNativeTitleBar || window.location.pathname === THEME_STUDIO_STANDALONE_PATHNAME) return;
const install = (): void => {
if (!document.body || document.getElementById(STARTUP_NATIVE_TITLEBAR_ID)) return;
const titlebar = document.createElement('div');