From da660a1ffa3218f8e6ec4dfd5422ca6c1ded38ae Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 17 Mar 2023 10:38:09 +0800 Subject: [PATCH] Update Android port * java/org/gnu/emacs/EmacsView.java (cancelPopupMenu): Dismiss context menu correctly. (isOpaque): New function. * java/org/gnu/emacs/EmacsWindowAttachmentManager.java: Make consumer list public. --- java/org/gnu/emacs/EmacsView.java | 21 +++++++++++++++++++ .../emacs/EmacsWindowAttachmentManager.java | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java index 878ef2f3fbf..681da98fa16 100644 --- a/java/org/gnu/emacs/EmacsView.java +++ b/java/org/gnu/emacs/EmacsView.java @@ -514,6 +514,17 @@ public final class EmacsView extends ViewGroup contextMenu = null; popupActive = false; + + /* It is not possible to know with 100% certainty which activity + is currently displaying the context menu. Loop through each + activity and call `closeContextMenu' instead. */ + + for (EmacsWindowAttachmentManager.WindowConsumer consumer + : EmacsWindowAttachmentManager.MANAGER.consumers) + { + if (consumer instanceof EmacsActivity) + ((EmacsActivity) consumer).closeContextMenu (); + } } @Override @@ -646,6 +657,16 @@ public final class EmacsView extends ViewGroup return isCurrentlyTextEditor; } + @Override + public boolean + isOpaque () + { + /* Returning true here allows the system to not draw the contents + of windows underneath this view, thereby improving + performance. */ + return true; + } + public synchronized void setICMode (int icMode) { diff --git a/java/org/gnu/emacs/EmacsWindowAttachmentManager.java b/java/org/gnu/emacs/EmacsWindowAttachmentManager.java index 30f29250970..c0197ab802c 100644 --- a/java/org/gnu/emacs/EmacsWindowAttachmentManager.java +++ b/java/org/gnu/emacs/EmacsWindowAttachmentManager.java @@ -67,7 +67,7 @@ public final class EmacsWindowAttachmentManager public void destroy (); }; - private List consumers; + public List consumers; public List windows; public -- 2.39.2