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

Fix context menu still displayed after clicking the clear button #2193

Merged
merged 1 commit into from
Nov 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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