当我使用remote.getCurrentWindow().maximize()在渲染进程中最大化window时,window max的动画不流畅,因为我使用ipcRenderer向主进程发送一条消息到window.maximize()。
document.getElementById('maxrender').addEventListener('click', () => {
// the animation is not smooth
if (currentWindow.isMaximized()) {
currentWindow.unmaximize();
} else {
currentWindow.maximize();
}
})
document.getElementById('maxmain').addEventListener('click', () => {
// the app will receive this message and call the same function
// the animation is smooth
ipc.send('window-max')
})点击'max with window‘和'max with ipc',动画的流畅度有很大的不同
发布于 2019-06-04 12:45:57
我已经在电子社区创建了一个问题#17858。
简单地说,remote调用是synchronous,它将阻塞一些ms的渲染进程。因此,动画效果不如asynchronous ipcRenderer的消息传递流畅。
https://stackoverflow.com/questions/55741031
复制相似问题