Skip to content

Commit 5d8f789

Browse files
committed
fix(desktop): background effects causing issues on Win10
1 parent 4faabb7 commit 5d8f789

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/server/src/routes/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import attributeService from "../services/attributes.js";
55
import config from "../services/config.js";
66
import optionService from "../services/options.js";
77
import log from "../services/log.js";
8-
import { isDev, isElectron, isWindows } from "../services/utils.js";
8+
import { isDev, isElectron, isWindows11 } from "../services/utils.js";
99
import protectedSessionService from "../services/protected_session.js";
1010
import packageJson from "../../package.json" with { type: "json" };
1111
import assetPath from "../services/asset_path.js";
@@ -42,7 +42,7 @@ function index(req: Request, res: Response) {
4242
platform: process.platform,
4343
isElectron,
4444
hasNativeTitleBar: isElectron && options.nativeTitleBarVisible === "true",
45-
hasBackgroundEffects: isWindows && isElectron && options.backgroundEffects === "true",
45+
hasBackgroundEffects: isElectron && isWindows11 && options.backgroundEffects === "true",
4646
mainFontSize: parseInt(options.mainFontSize),
4747
treeFontSize: parseInt(options.treeFontSize),
4848
detailFontSize: parseInt(options.detailFontSize),

apps/server/src/services/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@ import path from "path";
1212
import type NoteMeta from "./meta/note_meta.js";
1313
import log from "./log.js";
1414
import { t } from "i18next";
15+
import { release as osRelease } from "os";
16+
17+
const osVersion = osRelease().split('.').map(Number);
1518

1619
const randtoken = generator({ source: "crypto" });
1720

1821
export const isMac = process.platform === "darwin";
1922

2023
export const isWindows = process.platform === "win32";
2124

25+
export const isWindows11 = isWindows && osVersion[0] === 10 && osVersion[2] >= 22000;
26+
2227
export const isElectron = !!process.versions["electron"];
2328

2429
export const isDev = !!(process.env.TRILIUM_ENV && process.env.TRILIUM_ENV === "dev");

0 commit comments

Comments
 (0)