Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fix context menu still displayed after clicking the clear button (#2193)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and bluemarvin committed Nov 7, 2019
1 parent aa1a7d9 commit 8e45d1f
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public void onResume() {

public void close() {
TelemetryWrapper.closeWindowEvent(mWindowId);

hideContextMenus();
releaseWidget();
mBookmarksView.onDestroy();
mHistoryView.onDestroy();
Expand Down Expand Up @@ -1429,14 +1429,22 @@ public void onFxASynSettings(@NonNull View view) {

private void hideContextMenus() {
if (mContextMenu != null) {
mContextMenu.hide(REMOVE_WIDGET);
mContextMenu.releaseWidget();
if (!mContextMenu.isReleased()) {
if (mContextMenu.isVisible()) {
mContextMenu.hide(REMOVE_WIDGET);
}
mContextMenu.releaseWidget();
}
mContextMenu = null;
}
if (mSelectionMenu != null) {
mSelectionMenu.setDelegate((SelectionActionWidget.Delegate)null);
mSelectionMenu.hide(REMOVE_WIDGET);
mSelectionMenu.releaseWidget();
if (!mSelectionMenu.isReleased()) {
if (mSelectionMenu.isVisible()) {
mSelectionMenu.hide(REMOVE_WIDGET);
}
mSelectionMenu.releaseWidget();
}
mSelectionMenu = null;
}

Expand All @@ -1445,7 +1453,8 @@ private void hideContextMenus() {
mWidgetManager.updateWidget(this);
}

if (mLibraryItemContextMenu != null && mLibraryItemContextMenu.isVisible()) {
if (mLibraryItemContextMenu != null && !mLibraryItemContextMenu.isReleased()
&& mLibraryItemContextMenu.isVisible()) {
mLibraryItemContextMenu.hide(REMOVE_WIDGET);
}
}
Expand Down

0 comments on commit 8e45d1f

Please sign in to comment.