diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 2d40e819e682a1ff68ef3b662ed5ef7f74ccffed..f67981e8b268f5d0ff9ed10acb6009eb319ecee7 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -1032,8 +1032,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
     @Override
     public void onShowMoreKeysPanel(final MoreKeysPanel panel) {
         locatePreviewPlacerView();
-        if (isShowingMoreKeysPanel()) {
-            onDismissMoreKeysPanel();
+        // TODO: Remove this check
+        if (panel.isShowingInParent()) {
+            panel.dismissMoreKeysPanel();
         }
         mPreviewPlacerView.addView(panel.getContainerView());
         mMoreKeysPanel = panel;
@@ -1045,12 +1046,12 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
     }
 
     @Override
-    public void onCancelMoreKeysPanel() {
+    public void onCancelMoreKeysPanel(final MoreKeysPanel panel) {
         PointerTracker.dismissAllMoreKeysPanels();
     }
 
     @Override
-    public void onDismissMoreKeysPanel() {
+    public void onDismissMoreKeysPanel(final MoreKeysPanel panel) {
         dimEntireKeyboard(false /* dimmed */);
         if (isShowingMoreKeysPanel()) {
             mPreviewPlacerView.removeView(mMoreKeysPanel.getContainerView());
@@ -1213,7 +1214,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
     public void closing() {
         dismissAllKeyPreviews();
         cancelAllMessages();
-        onDismissMoreKeysPanel();
+        PointerTracker.dismissAllMoreKeysPanels();
         mMoreKeysKeyboardCache.clear();
     }
 
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
index ad4b2d86f2f8abaf07fa9fd8b8a0c228eb9eebdc..94f6a3cf269af0f85f30f22ceabe06230ee1f27f 100644
--- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
@@ -119,7 +119,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel
         onMoveKeyInternal(x, y, pointerId);
         if (hasOldKey && mCurrentKey == null) {
             // If the pointer has moved too far away from any target then cancel the panel.
-            mController.onCancelMoreKeysPanel();
+            mController.onCancelMoreKeysPanel(this);
         }
     }
 
@@ -177,7 +177,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel
         if (!isShowingInParent()) {
             return;
         }
-        mController.onDismissMoreKeysPanel();
+        mController.onDismissMoreKeysPanel(this);
     }
 
     @Override
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysPanel.java b/java/src/com/android/inputmethod/keyboard/MoreKeysPanel.java
index 1d3e18fd4116888e3819ad75bf1f49575f29ee79..886c6286fcb1b153d6d47b36833856284fc9cd10 100644
--- a/java/src/com/android/inputmethod/keyboard/MoreKeysPanel.java
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysPanel.java
@@ -22,28 +22,30 @@ public interface MoreKeysPanel {
     public interface Controller {
         /**
          * Add the {@link MoreKeysPanel} to the target view.
-         * @param panel
+         * @param panel the panel to be shown.
          */
         public void onShowMoreKeysPanel(final MoreKeysPanel panel);
 
         /**
          * Remove the current {@link MoreKeysPanel} from the target view.
+         * @param panel the panel to be dismissed.
          */
-        public void onDismissMoreKeysPanel();
+        public void onDismissMoreKeysPanel(final MoreKeysPanel panel);
 
         /**
          * Instructs the parent to cancel the panel (e.g., when entering a different input mode).
+         * @param panel the panel to be canceled.
          */
-        public void onCancelMoreKeysPanel();
+        public void onCancelMoreKeysPanel(final MoreKeysPanel panel);
     }
 
     public static final Controller EMPTY_CONTROLLER = new Controller() {
         @Override
         public void onShowMoreKeysPanel(final MoreKeysPanel panel) {}
         @Override
-        public void onDismissMoreKeysPanel() {}
+        public void onDismissMoreKeysPanel(final MoreKeysPanel panel) {}
         @Override
-        public void onCancelMoreKeysPanel() {}
+        public void onCancelMoreKeysPanel(final MoreKeysPanel panel) {}
     };
 
     /**
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
index 81fb1963f2b8ee16ad98f2eff7d288a2796115ea..497a791d97a7437e3ed8b99ed0d2503c75fdf093 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
@@ -181,8 +181,8 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
     private final MoreKeysPanel.Controller mMoreSuggestionsController =
             new MoreKeysPanel.Controller() {
         @Override
-        public void onDismissMoreKeysPanel() {
-            mMainKeyboardView.onDismissMoreKeysPanel();
+        public void onDismissMoreKeysPanel(final MoreKeysPanel panel) {
+            mMainKeyboardView.onDismissMoreKeysPanel(panel);
         }
 
         @Override
@@ -191,7 +191,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
         }
 
         @Override
-        public void onCancelMoreKeysPanel() {
+        public void onCancelMoreKeysPanel(final MoreKeysPanel panel) {
             mMoreSuggestionsView.dismissMoreKeysPanel();
         }
     };