| 198 | } |
| 199 | |
| 200 | handleWindowClose (pageOptions, page, window) { |
| 201 | window.on('close', (event) => { |
| 202 | if (pageOptions.bindCloseToHide && !this.willQuit) { |
| 203 | event.preventDefault() |
| 204 | |
| 205 | // @see https://github.com/electron/electron/issues/20263 |
| 206 | if (window.isFullScreen()) { |
| 207 | window.once('leave-full-screen', () => window.hide()) |
| 208 | |
| 209 | window.setFullScreen(false) |
| 210 | } else { |
| 211 | window.hide() |
| 212 | } |
| 213 | } |
| 214 | const bounds = window.getBounds() |
| 215 | this.emit('window-closed', { page, bounds }) |
| 216 | }) |
| 217 | } |
| 218 | |
| 219 | showWindow (page) { |
| 220 | const window = this.getWindow(page) |