Last active
November 14, 2018 10:58
-
-
Save ahkohd/c34595e4f62e9d348111a3507a267ace to your computer and use it in GitHub Desktop.
Work Around for Electron.JS Frameless window White Bar Bug After Maximize Cycle render process code snippet. https://medium.com/@victoraremu/fix-electron-js-frameless-window-white-bar-bug-after-maximize-cycle-fc1c59f4758c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { remote, screen, ipcRenderer } from 'electron'; | |
// … | |
customMaximize() | |
{ | |
// windows dimension and positon {width, height, x, y} | |
let resDetails = remote.getCurrentWindow().getBounds(); | |
// use ipcRender to send custom-resize event to main thread to invoke the custom resize event handler to resize the window…. | |
ipcRenderer.send('custom-maximize', this.screenSize.width, this.screenSize.height, resDetails); | |
} | |
customRestore() | |
{ | |
ipcRenderer.send('custom-restore'); | |
} | |
// Not part of the work around. It's just to test the work around out. | |
let btnMax = document.getElementById('btn-max'); | |
let btnRes = document.getElementById('btn-res'); | |
btnMax.addEventListener('click', function (e) { | |
e.preventDefault(); | |
customMaximize(); | |
}); | |
btnRes.addEventListener('click', function (e) { | |
e.preventDefault(); | |
customRestore(); | |
}); | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment