Make quit-on-escape optional

This commit is contained in:
Paul Rouget 2016-05-16 17:39:25 +02:00
parent 66acb1039e
commit 911a67b400
2 changed files with 6 additions and 2 deletions

View file

@ -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) => {