From 8df21d09d6493d66c1e7dd7e378e8d6b35ce63a9 Mon Sep 17 00:00:00 2001 From: Neko Date: Fri, 7 Aug 2026 00:16:59 +0800 Subject: [PATCH] fix(stage-tamagotchi): guard background material by platform (#2235) --- apps/stage-tamagotchi/src/main/services/electron/window.ts | 3 ++- apps/stage-tamagotchi/src/renderer/pages/inlay/index.vue | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/stage-tamagotchi/src/main/services/electron/window.ts b/apps/stage-tamagotchi/src/main/services/electron/window.ts index 815b025d1..ebe61ec04 100644 --- a/apps/stage-tamagotchi/src/main/services/electron/window.ts +++ b/apps/stage-tamagotchi/src/main/services/electron/window.ts @@ -6,6 +6,7 @@ import type { ElectronWindowLifecycleState } from '../../../shared/eventa' import { defineInvokeHandler } from '@moeru/eventa' import { bounds, startLoopGetBounds } from '@proj-airi/electron-eventa' import { createRendererLoop, safeClose } from '@proj-airi/electron-vueuse/main' +import { isWindows } from 'std-env' import { electron, @@ -97,7 +98,7 @@ export function createWindowService(params: { context: ReturnType { - if (backgroundMaterial && params.window.webContents.id === options?.raw.ipcMainEvent.sender.id) { + if (isWindows && backgroundMaterial && params.window.webContents.id === options?.raw.ipcMainEvent.sender.id) { params.window.setBackgroundMaterial(backgroundMaterial[0]) } }) diff --git a/apps/stage-tamagotchi/src/renderer/pages/inlay/index.vue b/apps/stage-tamagotchi/src/renderer/pages/inlay/index.vue index 287ad1a68..edeee934d 100644 --- a/apps/stage-tamagotchi/src/renderer/pages/inlay/index.vue +++ b/apps/stage-tamagotchi/src/renderer/pages/inlay/index.vue @@ -4,11 +4,14 @@ import type { BackgroundMaterialType, VibrancyType } from '@proj-airi/electron-e import { electron } from '@proj-airi/electron-eventa' import { useElectronEventaInvoke } from '@proj-airi/electron-vueuse' import { FieldCombobox } from '@proj-airi/ui' +import { useAsyncState } from '@vueuse/core' import { ref, watch } from 'vue' +const getIsWindows = useElectronEventaInvoke(electron.app.isWindows) const setVibrancy = useElectronEventaInvoke(electron.window.setVibrancy) const setBackgroundMaterial = useElectronEventaInvoke(electron.window.setBackgroundMaterial) +const { state: isWindows } = useAsyncState(() => getIsWindows(), false) const vibrancy = ref>() const backgroundMaterial = ref>() @@ -63,6 +66,7 @@ watch( />