From d698fd207ed5b1023995d5d14d8ffef5f3327fb8 Mon Sep 17 00:00:00 2001 From: Michael Goffioul Date: Thu, 21 Jan 2021 15:31:29 -0500 Subject: [PATCH 1/2] GH-1156: Restore key event handlers when a DOM element is fullscreen Make sure to call dispatchKeyEvent from base class in WrapperView, if the event hasn't been handled by the engine. --- framework/src/org/apache/cordova/CordovaWebViewImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/CordovaWebViewImpl.java b/framework/src/org/apache/cordova/CordovaWebViewImpl.java index a77502d6ef..eeafcce2f4 100644 --- a/framework/src/org/apache/cordova/CordovaWebViewImpl.java +++ b/framework/src/org/apache/cordova/CordovaWebViewImpl.java @@ -255,7 +255,12 @@ public WrapperView(Context context, CordovaWebViewEngine engine) { @Override public boolean dispatchKeyEvent(KeyEvent event) { - return engine.getView().dispatchKeyEvent(event); + boolean ret = engine.getView().dispatchKeyEvent(event); + if (! ret) { + // If the engine didn't handle the event, handle it normally. + ret = super.dispatchKeyEvent(event); + } + return ret; } } From 12fbca31540828d84cd0d1fb140c17e84b36e83c Mon Sep 17 00:00:00 2001 From: goffioul Date: Mon, 25 Jan 2021 12:13:57 -0500 Subject: [PATCH 2/2] Remove unwanted whitespace in condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: エリス --- framework/src/org/apache/cordova/CordovaWebViewImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/CordovaWebViewImpl.java b/framework/src/org/apache/cordova/CordovaWebViewImpl.java index eeafcce2f4..6854a308ca 100644 --- a/framework/src/org/apache/cordova/CordovaWebViewImpl.java +++ b/framework/src/org/apache/cordova/CordovaWebViewImpl.java @@ -256,7 +256,7 @@ public WrapperView(Context context, CordovaWebViewEngine engine) { @Override public boolean dispatchKeyEvent(KeyEvent event) { boolean ret = engine.getView().dispatchKeyEvent(event); - if (! ret) { + if (!ret) { // If the engine didn't handle the event, handle it normally. ret = super.dispatchKeyEvent(event); }