Fixed taskbar finishes before render

This commit is contained in:
2022-07-07 11:51:27 +02:00
parent f6d1ed0477
commit 3c70be134a
2 changed files with 10 additions and 6 deletions

View File

@@ -117,12 +117,13 @@ function startBlender() {
renderInfo.endTime = new Date().getTime(); renderInfo.endTime = new Date().getTime();
if(lastFrame == frames) { if(lastFrame == frames) {
openPage(Page.RenderFinish); openPage(Page.RenderFinish);
ipcRenderer.send("renderFinished");
// TODO: only show notification if not in do not disturb mode, currently not working. Details: https://github.com/felixrieseberg/macos-notification-state/issues/30 // TODO: only show notification if not in do not disturb mode, currently not working. Details: https://github.com/felixrieseberg/macos-notification-state/issues/30
new Notification("Render Finished", { new Notification("Render Finished", {
body: "Rendering finished successfully!", body: "Rendering finished successfully!",
icon: finsishedIconPath icon: finsishedIconPath
}).onclick = function() { }).onclick = function() {
ipcRenderer.send("openApp"); ipcRenderer.send("openApp");
} }
} else { } else {
logger.errorMSG("Render Failed!"); logger.errorMSG("Render Failed!");

View File

@@ -118,7 +118,10 @@ const createWindow = () => {
ipcMain.on('setProgress', (event, arg) => { ipcMain.on('setProgress', (event, arg) => {
const progress = parseFloat(arg); const progress = parseFloat(arg);
mainWindow.setProgressBar(progress); mainWindow.setProgressBar(progress);
if(progress === 1 && !mainWindow.isFocused()) { });
ipcMain.on('renderFinished', () => {
if(!mainWindow.isFocused()) {
mainWindow.setOverlayIcon(finsishedIconPath as unknown as NativeImage, 'Rendering Complete'); mainWindow.setOverlayIcon(finsishedIconPath as unknown as NativeImage, 'Rendering Complete');
mainWindow.flashFrame(true); mainWindow.flashFrame(true);
} }