From 574a22a6cd0ca4a6eb9e6af4541f835f22691768 Mon Sep 17 00:00:00 2001 From: Manuel Rego Casasnovas Date: Thu, 27 Jun 2024 05:43:05 +0200 Subject: [PATCH] Avoid Esc shortcut to close Servo (#32603) * Avoid Esc shortcut to close Servo Keep Esc shortcut to leave fullscreen, but avoid to close Servo (as this is not common in other similar apps, and can be shortcut used in some web apps for other things). * Send Esc to the page --- README.md | 3 ++- ports/servoshell/desktop/webview.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d0216816b40..3c7127cbe76 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,8 @@ Run Servo with the command: - `Ctrl`+`=` zooms in (`Cmd`+`=` on Mac) - `Alt`+`left arrow` goes backwards in the history (`Cmd`+`left arrow` on Mac) - `Alt`+`right arrow` goes forwards in the history (`Cmd`+`right arrow` on Mac) -- `Esc` or `Ctrl`+`Q` exits Servo (`Cmd`+`Q` on Mac) +- `Ctrl`+`Q` exits Servo (`Cmd`+`Q` on Mac) +- `Esc` exits fullscreen ### Runtime dependencies diff --git a/ports/servoshell/desktop/webview.rs b/ports/servoshell/desktop/webview.rs index ec6ab2fbf0a..920a6a61477 100644 --- a/ports/servoshell/desktop/webview.rs +++ b/ports/servoshell/desktop/webview.rs @@ -343,7 +343,7 @@ where self.event_queue.push(event); } } else { - self.event_queue.push(EmbedderEvent::Quit); + self.platform_handle_key(key_event.clone()); } }) .otherwise(|| self.platform_handle_key(key_event));