diff --git a/docs/docs/config.mdx b/docs/docs/config.mdx index 05389e99ef..ad8b81d64e 100644 --- a/docs/docs/config.mdx +++ b/docs/docs/config.mdx @@ -99,6 +99,7 @@ wsh editconfig | widget:showhelp | bool | whether to show help/tips widgets in right sidebar | | window:transparent | bool | set to true to enable window transparency (cannot be combined with `window:blur`) (macOS and Windows only, requires app restart, see [note on Windows compatibility](https://www.electronjs.org/docs/latest/tutorial/custom-window-styles#limitations)) | | window:blur | bool | set to enable window background blurring (cannot be combined with `window:transparent`) (macOS and Windows only, requires app restart, see [note on Windows compatibility](https://www.electronjs.org/docs/latest/tutorial/custom-window-styles#limitations)) | +| window:visualeffectstate | string | controls whether macOS vibrancy follows window focus (`followWindow`, default), always appears active (`active`), or always appears inactive (`inactive`); macOS only, ignored on other platforms, requires `window:blur` and an app restart | | window:opacity | float64 | 0-1, window opacity when `window:transparent` or `window:blur` are set | | window:bgcolor | string | set the window background color (should be hex: #xxxxxx) | | window:reducedmotion | bool | set to true to disable most animations | diff --git a/emain/emain-window.ts b/emain/emain-window.ts index e3bfa87751..8e30b49e5a 100644 --- a/emain/emain-window.ts +++ b/emain/emain-window.ts @@ -180,6 +180,11 @@ export class WaveBrowserWindow extends BaseWindow { winOpts.transparent = true; } else if (isBlur) { winOpts.vibrancy = "fullscreen-ui"; + const visualEffectState = settings?.["window:visualeffectstate"]; + winOpts.visualEffectState = + visualEffectState === "active" || visualEffectState === "inactive" + ? visualEffectState + : "followWindow"; } else { winOpts.backgroundColor = "#222222"; } diff --git a/frontend/types/gotypes.d.ts b/frontend/types/gotypes.d.ts index c5b870d7ed..513eff19be 100644 --- a/frontend/types/gotypes.d.ts +++ b/frontend/types/gotypes.d.ts @@ -1453,6 +1453,7 @@ declare global { "window:fullscreenonlaunch"?: boolean; "window:transparent"?: boolean; "window:blur"?: boolean; + "window:visualeffectstate"?: string; "window:opacity"?: number; "window:bgcolor"?: string; "window:reducedmotion"?: boolean; diff --git a/pkg/wconfig/metaconsts.go b/pkg/wconfig/metaconsts.go index 7d5bba5d9d..c10f8d47d5 100644 --- a/pkg/wconfig/metaconsts.go +++ b/pkg/wconfig/metaconsts.go @@ -96,6 +96,7 @@ const ( ConfigKey_WindowFullscreenOnLaunch = "window:fullscreenonlaunch" ConfigKey_WindowTransparent = "window:transparent" ConfigKey_WindowBlur = "window:blur" + ConfigKey_WindowVisualEffectState = "window:visualeffectstate" ConfigKey_WindowOpacity = "window:opacity" ConfigKey_WindowBgColor = "window:bgcolor" ConfigKey_WindowReducedMotion = "window:reducedmotion" diff --git a/pkg/wconfig/settingsconfig.go b/pkg/wconfig/settingsconfig.go index 67118b1670..4c5b0690b0 100644 --- a/pkg/wconfig/settingsconfig.go +++ b/pkg/wconfig/settingsconfig.go @@ -147,6 +147,7 @@ type SettingsType struct { WindowFullscreenOnLaunch bool `json:"window:fullscreenonlaunch,omitempty"` WindowTransparent bool `json:"window:transparent,omitempty"` WindowBlur bool `json:"window:blur,omitempty"` + WindowVisualEffectState string `json:"window:visualeffectstate,omitempty" jsonschema:"enum=followWindow,enum=active,enum=inactive"` WindowOpacity *float64 `json:"window:opacity,omitempty"` WindowBgColor string `json:"window:bgcolor,omitempty"` WindowReducedMotion bool `json:"window:reducedmotion,omitempty"` diff --git a/schema/settings.json b/schema/settings.json index f341a0f365..ea42563929 100644 --- a/schema/settings.json +++ b/schema/settings.json @@ -259,6 +259,14 @@ "window:blur": { "type": "boolean" }, + "window:visualeffectstate": { + "type": "string", + "enum": [ + "followWindow", + "active", + "inactive" + ] + }, "window:opacity": { "type": "number" },