Here's the thing, you absolutely can do this in exactly the same way: Make the background transparent and draw within the bounds. You can argue about whether or not you should, but that is the argument. There's no technical limitation.
https://www.electronjs.org/docs/latest/tutorial/custom-windo...