From 290bdc21a91e7002293a90d9319fbdea3fa2ecf8 Mon Sep 17 00:00:00 2001 From: nashaofu Date: Sun, 23 Apr 2023 23:17:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E7=BB=9F=E4=BF=A1OS?= =?UTF-8?q?=20#203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/electron-screenshots/src/screenshots.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/electron-screenshots/src/screenshots.ts b/packages/electron-screenshots/src/screenshots.ts index 3848ac4..bd65c2a 100644 --- a/packages/electron-screenshots/src/screenshots.ts +++ b/packages/electron-screenshots/src/screenshots.ts @@ -155,7 +155,9 @@ export default class Screenshots extends Events { if (!this.$win || this.$win?.isDestroyed?.()) { const windowTypes: Record = { darwin: 'panel', - linux: 'dock', + // linux 必须设置为 undefined,否则会在部分系统上不能触发focus 事件 + // https://github.com/nashaofu/screenshots/issues/203#issuecomment-1518923486 + linux: undefined, win32: 'toolbar', };