diff --git a/src/ipc/types.ts b/src/ipc/types.ts index 024680ec..c8bf4dc1 100644 --- a/src/ipc/types.ts +++ b/src/ipc/types.ts @@ -51,7 +51,8 @@ type WidgetWellKnownFlag = 'has-browser' | 'invisible-on-blur' | 'hide-on-blur' | - 'hide-on-blur(close)' + 'hide-on-blur(close)' | + 'hide-on-focus' export const defaultConfig: Config = { configVersion: 3, diff --git a/src/main/config.ts b/src/main/config.ts index 4167e731..69b387f9 100644 --- a/src/main/config.ts +++ b/src/main/config.ts @@ -47,7 +47,7 @@ export const config = (() => { config.fontSize = defaultConfig.fontSize } - { + { // config.configVersion < 2 (undefined) const mapWidget = config.widgets.find(w => w.wmType === 'map-check')! if (mapWidget.wmZorder !== 'exclusive') { mapWidget.wmZorder = 'exclusive' diff --git a/src/web/overlay/OverlayWindow.vue b/src/web/overlay/OverlayWindow.vue index c943e595..8632d574 100644 --- a/src/web/overlay/OverlayWindow.vue +++ b/src/web/overlay/OverlayWindow.vue @@ -101,6 +101,12 @@ export default { } } } + } else { + for (const w of this.widgets) { + if (w.wmFlags.includes('hide-on-focus')) { + this.hide(w.wmId) + } + } } }) MainProcess.addEventListener(VISIBILITY, ({ detail: e }) => { diff --git a/src/web/settings/maps.vue b/src/web/settings/maps.vue index a25c7dcd..8d5b80a5 100644 --- a/src/web/settings/maps.vue +++ b/src/web/settings/maps.vue @@ -15,7 +15,7 @@ -