diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java index 938e2a21d1a..8f16dbad257 100644 --- a/java/org/gnu/emacs/EmacsView.java +++ b/java/org/gnu/emacs/EmacsView.java @@ -707,6 +707,8 @@ else if (child.getVisibility () != GONE) popupMenu (EmacsContextMenu menu, int xPosition, int yPosition, boolean force) { + ContextThemeWrapper context; + if (popupActive && !force) return false; @@ -720,6 +722,16 @@ else if (child.getVisibility () != GONE) contextMenu = menu; popupActive = true; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) + { + context = (ContextThemeWrapper) getContext (); + /* It is necessary to reload the current theme before attempting + to display a new popup menu, or any previously applied system + theme will continue to apply to it. */ + context.setTheme (R.style.EmacsStyleOpen); + context.setTheme (R.style.EmacsStyle); + } + /* Use showContextMenu (float, float) on N to get actual popup behavior. */ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)