From 28dd6072292a2fda3707886fd657158d66e5c358 Mon Sep 17 00:00:00 2001 From: kvan7 Date: Fri, 28 Aug 2026 07:05:01 -0500 Subject: [PATCH] put hiding overlay on blur behind option --- ipc/types.ts | 1 + main/src/main.ts | 6 +++++- main/src/windowing/OverlayWindow.ts | 13 ++++++++++--- renderer/public/data/en/app_i18n.json | 4 +++- renderer/src/web/Config.ts | 12 +++++++++++- renderer/src/web/settings/general.vue | 10 ++++++++++ 6 files changed, 40 insertions(+), 6 deletions(-) diff --git a/ipc/types.ts b/ipc/types.ts index f401ba2e..9ddef094 100644 --- a/ipc/types.ts +++ b/ipc/types.ts @@ -12,6 +12,7 @@ export interface HostConfig { libraryAlpha: boolean; libraryOutputPath: string | null; initialDelay: number; + hideOverlayOnBlur: boolean; } export interface ShortcutAction { diff --git a/main/src/main.ts b/main/src/main.ts index ac14f0e6..d2f55d7d 100644 --- a/main/src/main.ts +++ b/main/src/main.ts @@ -104,7 +104,11 @@ let tray: AppTray; eventPipe.onEventAnyClient( "CLIENT->MAIN::update-host-config", (cfg) => { - overlay.updateOpts(cfg.overlayKey, cfg.windowTitle); + overlay.updateOpts( + cfg.overlayKey, + cfg.windowTitle, + cfg.hideOverlayOnBlur, + ); shortcuts.updateActions( cfg.shortcuts, cfg.stashScroll, diff --git a/main/src/windowing/OverlayWindow.ts b/main/src/windowing/OverlayWindow.ts index 837e0868..9d9f3daa 100644 --- a/main/src/windowing/OverlayWindow.ts +++ b/main/src/windowing/OverlayWindow.ts @@ -15,6 +15,7 @@ export class OverlayWindow { private overlayKey: string = "Shift + Space"; private isOverlayKeyUsed = false; private shouldShowOverlay = true; + private hideOverlayOnBlur = false; constructor( private server: ServerEvents, @@ -120,9 +121,14 @@ export class OverlayWindow { } }; - updateOpts(overlayKey: string, windowTitle: string) { + updateOpts( + overlayKey: string, + windowTitle: string, + hideOverlayOnBlur: boolean, + ) { this.overlayKey = overlayKey; this.poeWindow.attach(this.window, windowTitle); + this.hideOverlayOnBlur = hideOverlayOnBlur; } private handleExtraCommands = ( @@ -200,7 +206,7 @@ export class OverlayWindow { }; private syncWindowVisibility() { - if (!this.window) return; + if (!this.window || !this.hideOverlayOnBlur) return; if ( this.isInteractable || @@ -213,7 +219,8 @@ export class OverlayWindow { } private showOverlay() { - if (!this.window || this.window.isVisible()) return; + if (!this.window || this.window.isVisible() || !this.hideOverlayOnBlur) + return; this.window.showInactive(); this.window.setAlwaysOnTop(true, "screen-saver"); diff --git a/renderer/public/data/en/app_i18n.json b/renderer/public/data/en/app_i18n.json index cc3df46a..ac815e63 100644 --- a/renderer/public/data/en/app_i18n.json +++ b/renderer/public/data/en/app_i18n.json @@ -394,7 +394,9 @@ "tips_header": "Cycle Through All Tips:", "tip_number_header": "Tip #{0}", "read_client_log": "Allow reading of Client.txt file", - "client_log_explain": "Client.txt log file contains debugging info and chat logs. This is used to detect zone changes and player level ups." + "client_log_explain": "Client.txt log file contains debugging info and chat logs. This is used to detect zone changes and player level ups.", + "hide_overlay_on_blur": "Fully hide overlay when it loses focus instead of making it transparent.", + "hide_overlay_on_blur_hint": "This may gain performance improvements on some systems, but may induce flickering." }, "price_check": { "name": "Price check", diff --git a/renderer/src/web/Config.ts b/renderer/src/web/Config.ts index 931e3b52..d1419c69 100644 --- a/renderer/src/web/Config.ts +++ b/renderer/src/web/Config.ts @@ -130,6 +130,7 @@ export interface Config { overlayKey: string; overlayBackground: string; overlayBackgroundClose: boolean; + hideOverlayOnBlur: boolean; restoreClipboard: boolean; commands: Array<{ text: string; @@ -156,11 +157,12 @@ export interface Config { } export const defaultConfig = (): Config => ({ - configVersion: 34, + configVersion: 35, overlayKey: "Shift + Space", overlayBackground: "rgba(129, 139, 149, 0.15)", overlayBackgroundClose: true, overlayAlwaysClose: false, + hideOverlayOnBlur: false, restoreClipboard: false, showAttachNotification: true, commands: [ @@ -667,8 +669,15 @@ function upgradeConfig(_config: Config): Config { libraryWidget.selectedProfile = "chaos"; libraryWidget.profiles.chaos!.modOpts.generation = true; + // why is this one higher? config.configVersion = 34; } + + if (config.configVersion < 35) { + // NOTE: v0.16.0 || poe0.5.5 + config.hideOverlayOnBlur = false; + config.configVersion = 35; + } /* eslint-enable */ return config as unknown as Config; @@ -823,5 +832,6 @@ function getConfigForHost(): HostConfig { libraryAlpha: config.enableAlphas && config.alphas.includes("library"), libraryOutputPath: library.libraryOutputPath, initialDelay: priceCheck.initialDelay, + hideOverlayOnBlur: config.hideOverlayOnBlur, }; } diff --git a/renderer/src/web/settings/general.vue b/renderer/src/web/settings/general.vue index e84ce7fb..1cb22df1 100644 --- a/renderer/src/web/settings/general.vue +++ b/renderer/src/web/settings/general.vue @@ -86,6 +86,12 @@ {{ t(":overlay_always_close") }} + {{ + t(":hide_overlay_on_blur") + }} +
+ {{ t(":hide_overlay_on_blur_hint") }} +
{{ t(":window_title") }} @@ -218,6 +224,10 @@ export default defineComponent({ () => props.config, "overlayAlwaysClose", ), + hideOverlayOnBlur: configModelValue( + () => props.config, + "hideOverlayOnBlur", + ), windowTitle: configModelValue(() => props.config, "windowTitle"), enableAlphas: configModelValue(() => props.config, "enableAlphas"), readClientLog: configModelValue(() => props.config, "readClientLog"),