Last active
October 16, 2018 12:20
-
-
Save andreastt/749ac49ba4836a7d8fa1369b80a822b9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
async function restoreWindow(window) { | |
let cb; | |
await new TimedPromise(resolve => { | |
cb = new DebounceCallback(resolve); | |
window.addEventListener("sizemodechange", cb); | |
window.fullScreen = false; | |
}); | |
window.removeEventListener("sizemodechange", cb); | |
} |
This file contains hidden or 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
async function restoreFullscreen(window) { | |
let cb; | |
await new TimedPromise(resolve => { | |
cb = () => { | |
if (WindowState.from(window.windowState) == WindowState.Normal) { | |
resolve(); | |
} | |
}; | |
window.addEventListener("sizemodechange", cb); | |
window.fullScreen = false; | |
}); | |
window.removeEventListener("sizemodechange", cb); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment