desktop: prevent setting privacy mode on linux

This commit is contained in:
Abdullah Atta
2023-02-14 10:00:52 +05:00
parent cb1c023815
commit 6f2127abb8

View File

@@ -20,13 +20,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { setPrivacyMode } from "../../config/privacyMode";
export default (args) => {
if (!globalThis.window) return;
if (!globalThis.window || !["win32", "darwin"].includes(process.platform))
return;
const { privacyMode } = args;
globalThis.window.setContentProtection(privacyMode);
globalThis.window.setThumbnailClip(
privacyMode
? { x: 0, y: 0, width: 1, height: 1 }
: { x: 0, y: 0, width: 0, height: 0 }
);
if (process.platform === "win32") {
globalThis.window.setThumbnailClip(
privacyMode
? { x: 0, y: 0, width: 1, height: 1 }
: { x: 0, y: 0, width: 0, height: 0 }
);
}
setPrivacyMode(privacyMode);
};