Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

desktop: hide window thumbnail on Windows in privacy mode

Abdullah Atta06aff69adb97
diff --git a/apps/web/desktop/electron.js b/apps/web/desktop/electron.js
index 21edbe534..b28d9d2b0 100644
--- a/apps/web/desktop/electron.js
+++ b/apps/web/desktop/electron.js
@@ -34,6 +34,7 @@ import { sendMessageToRenderer } from "./ipc/utils";
import { EVENTS } from "./events";
import "./ipc/index.js";
import getPrivacyMode from "./ipc/calls/getPrivacyMode";
+import setPrivacyMode from "./ipc/actions/setPrivacyMode";
if (!RELEASE) {
require("electron-reloader")(module);
@@ -88,7 +89,7 @@ async function createWindow() {
mainWindow.webContents.openDevTools({ mode: "right", activate: true });
if (getPrivacyMode()) {
- global.win.setContentProtection(true);
+ setPrivacyMode({ privacyMode: getPrivacyMode() });
}
try {
diff --git a/apps/web/desktop/ipc/actions/setPrivacyMode.js b/apps/web/desktop/ipc/actions/setPrivacyMode.js
index 43378f5cc..facdde2b3 100644
--- a/apps/web/desktop/ipc/actions/setPrivacyMode.js
+++ b/apps/web/desktop/ipc/actions/setPrivacyMode.js
@@ -23,5 +23,10 @@ export default (args) => {
if (!global.win) return;
const { privacyMode } = args;
global.win.setContentProtection(privacyMode);
+ global.win.setThumbnailClip(
+ privacyMode
+ ? { x: 0, y: 0, width: 1, height: 1 }
+ : { x: 0, y: 0, width: 0, height: 0 }
+ );
setPrivacyMode(privacyMode);
};