diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index 6004fafaa42..40368e4ddf6 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -34,6 +34,7 @@ use util::geometry::ScreenPx; use util::opts; #[cfg(not(target_os = "android"))] use util::opts::RenderApi; +use util::prefs; use util::resource_files; static mut g_nested_event_loop_listener: Option<*mut (NestedEventLoopListener + 'static)> = None; @@ -768,7 +769,9 @@ impl WindowMethods for Window { } (NONE, Key::Escape) => { - self.event_queue.borrow_mut().push(WindowEvent::Quit); + if let Some(true) = prefs::get_pref("shell.quit-on-escape.enabled").as_boolean() { + self.event_queue.borrow_mut().push(WindowEvent::Quit); + } } (CMD_OR_ALT, Key::Right) => { diff --git a/resources/prefs.json b/resources/prefs.json index 03ad2d4918d..c3aea5eae36 100644 --- a/resources/prefs.json +++ b/resources/prefs.json @@ -55,6 +55,7 @@ "layout.writing-mode.enabled": false, "network.http.redirection-limit": 20, "network.mime.sniff": false, + "shell.homepage": "http://servo.org", "shell.native-titlebar.enabled": true, - "shell.homepage": "http://servo.org" + "shell.quit-on-escape.enabled": true }