mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Show prompt to force closing window when window is frozen.
Fixed atom/atom-shell#17.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
BrowserWindow = require 'browser-window'
|
||||
dialog = require 'dialog'
|
||||
ipc = require 'ipc'
|
||||
|
||||
module.exports =
|
||||
@@ -21,6 +22,14 @@ class AtomWindow
|
||||
@browserWindow.on 'destroyed', =>
|
||||
global.atomApplication.removeWindow(this)
|
||||
|
||||
@browserWindow.on 'unresponsive', =>
|
||||
chosen = dialog.showMessageBox
|
||||
type: 'warning'
|
||||
buttons: ['Close', 'Keep Waiting']
|
||||
message: 'Editor window is frozen'
|
||||
detail: "The editor window becomes frozen because of JavaScript dead loop, you can force closing it or just keep waiting."
|
||||
@browserWindow.destroy() if chosen is 0
|
||||
|
||||
if @isSpec
|
||||
# Spec window's web view should always have focus
|
||||
@browserWindow.on 'blur', =>
|
||||
|
||||
Reference in New Issue
Block a user