fix(desktop): background effects causing issues on Win10

This commit is contained in:
Elian Doran 2025-09-06 17:47:13 +03:00
parent 4faabb7770
commit 5d8f789791
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

View File

@ -5,7 +5,7 @@ import attributeService from "../services/attributes.js";
import config from "../services/config.js";
import optionService from "../services/options.js";
import log from "../services/log.js";
import { isDev, isElectron, isWindows } from "../services/utils.js";
import { isDev, isElectron, isWindows11 } from "../services/utils.js";
import protectedSessionService from "../services/protected_session.js";
import packageJson from "../../package.json" with { type: "json" };
import assetPath from "../services/asset_path.js";
@ -42,7 +42,7 @@ function index(req: Request, res: Response) {
platform: process.platform,
isElectron,
hasNativeTitleBar: isElectron && options.nativeTitleBarVisible === "true",
hasBackgroundEffects: isWindows && isElectron && options.backgroundEffects === "true",
hasBackgroundEffects: isElectron && isWindows11 && options.backgroundEffects === "true",
mainFontSize: parseInt(options.mainFontSize),
treeFontSize: parseInt(options.treeFontSize),
detailFontSize: parseInt(options.detailFontSize),

View File

@ -12,6 +12,9 @@ import path from "path";
import type NoteMeta from "./meta/note_meta.js";
import log from "./log.js";
import { t } from "i18next";
import { release as osRelease } from "os";
const osVersion = osRelease().split('.').map(Number);
const randtoken = generator({ source: "crypto" });
@ -19,6 +22,8 @@ export const isMac = process.platform === "darwin";
export const isWindows = process.platform === "win32";
export const isWindows11 = isWindows && osVersion[0] === 10 && osVersion[2] >= 22000;
export const isElectron = !!process.versions["electron"];
export const isDev = !!(process.env.TRILIUM_ENV && process.env.TRILIUM_ENV === "dev");