Since the Electron upgrade, Windows users are hitting a weird error
about `global-shortcut` not existing.
A solution is to `require('global-shortcut')` instead of accessing it as
a property of `electorn`.
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
From the documentation:
> `useContentSize` Boolean - The `width` and `height` would be used as web
> page’s size, which means the actual window’s size will include window
> frame’s size and be slightly larger. Default is `false`.
The original issue is that when you specify a width/height, the actual
size that you get is slighly smaller, since the OS title bar is included
in the size you provide.
By using the `useContentSize` option, we ensure the `WebView` gets the
intended size, no matter the title bar.
This PR invalidates: https://github.com/resin-io/etcher/pull/244
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
Turns out that even by using `process.exit(1)`, the electron main
process doesn't exit instantly, but continues executing code.
This causes electron to throw on `electron.globalShortcut` because this
functionality is not available given that we didn't create a renderer
view.
Fixes: https://github.com/resin-io/etcher/issues/215