mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 23:05:49 +00:00
Fix update toast visibility off macOS
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { getUpdateToastWindowAppearance } from "./updateToastWindowOptions";
|
||||
|
||||
describe("update toast window appearance", () => {
|
||||
it("uses native transparency on macOS", () => {
|
||||
expect(getUpdateToastWindowAppearance("darwin")).toEqual({
|
||||
transparent: true,
|
||||
backgroundColor: "#00000000",
|
||||
});
|
||||
});
|
||||
|
||||
it.each(["win32", "linux"] as const)("uses a visible opaque fallback on %s", (platform) => {
|
||||
expect(getUpdateToastWindowAppearance(platform)).toEqual({
|
||||
transparent: false,
|
||||
backgroundColor: "#101418",
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
export function getUpdateToastWindowAppearance(platform: NodeJS.Platform) {
|
||||
const transparent = platform === "darwin";
|
||||
|
||||
return {
|
||||
transparent,
|
||||
backgroundColor: transparent ? "#00000000" : "#101418",
|
||||
};
|
||||
}
|
||||
+4
-2
@@ -12,6 +12,7 @@ import {
|
||||
} from "./hudOverlayBounds";
|
||||
import { getHudOverlayTaskbarOptions } from "./hudOverlayWindowOptions";
|
||||
import { getPackagedRendererBaseUrl } from "./rendererServer";
|
||||
import { getUpdateToastWindowAppearance } from "./updateToastWindowOptions";
|
||||
|
||||
const electronWindowsDir = path.dirname(fileURLToPath(import.meta.url));
|
||||
const nodeRequire = createRequire(import.meta.url);
|
||||
@@ -689,6 +690,7 @@ export function setHudOverlayRecordingActive(recording: boolean): void {
|
||||
|
||||
export function createUpdateToastWindow(): BrowserWindow {
|
||||
const initialBounds = getUpdateToastBounds();
|
||||
const appearance = getUpdateToastWindowAppearance(process.platform);
|
||||
|
||||
const win = new BrowserWindow({
|
||||
width: initialBounds.width,
|
||||
@@ -696,14 +698,14 @@ export function createUpdateToastWindow(): BrowserWindow {
|
||||
x: initialBounds.x,
|
||||
y: initialBounds.y,
|
||||
frame: false,
|
||||
transparent: true,
|
||||
transparent: appearance.transparent,
|
||||
resizable: false,
|
||||
alwaysOnTop: true,
|
||||
skipTaskbar: true,
|
||||
hasShadow: false,
|
||||
show: false,
|
||||
focusable: true,
|
||||
backgroundColor: "#00000000",
|
||||
backgroundColor: appearance.backgroundColor,
|
||||
webPreferences: {
|
||||
preload: path.join(electronWindowsDir, "preload.mjs"),
|
||||
nodeIntegration: false,
|
||||
|
||||
Reference in New Issue
Block a user