I removed frame from electron and added custom buttons for collapsing, closing and maximizing/minimizing.
collapsing and closing works fine, but minimize/maximize makes blinks and returns to fullscreen
const [bounds, setBounds] = useState({width: 600, height: 600, x: 50, y: 50})
is a default bounds
useEffect(() => {
if (maximized) {
remote.BrowserWindow.getFocusedWindow().maximize()
} else {
//here is a problem
remote.BrowserWindow.getFocusedWindow().setBounds(bounds)
}
}, [bounds, bounds.height, bounds.width, maximized])
How to resize window correctly? Also I tried remote.BrowserWindow.getFocusedWindow().setSize()