🔧 I can't believe this helps

This commit is contained in:
Felix Rieseberg 2017-10-30 11:19:50 -07:00
parent e4214a6cbe
commit 91414dde62

View file

@ -117,6 +117,14 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
bool center; bool center;
if (options.Get(options::kX, &x) && options.Get(options::kY, &y)) { if (options.Get(options::kX, &x) && options.Get(options::kY, &y)) {
SetPosition(gfx::Point(x, y)); SetPosition(gfx::Point(x, y));
#if DEFINEED(OS_WIN)
// Dirty, dirty workaround for
// https://github.com/electron/electron/issues/10862
// Somehow, we need to call `SetBounds` twice to get
// usable results. The root cause is still unknown.
SetPosition(gfx::Point(x, y));
#endif
} else if (options.Get(options::kCenter, &center) && center) { } else if (options.Get(options::kCenter, &center) && center) {
Center(); Center();
} }