Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2613)

Unified Diff: ash/shelf/shelf_button.cc

Issue 2975063003: [Merge M60] Fix shelf dragging context in case Context Menu is shown. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/shelf/shelf_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_button.cc
diff --git a/ash/shelf/shelf_button.cc b/ash/shelf/shelf_button.cc
index 53cf800bbb5e92de9455233308ccf9c3be89871c..d9fa9a4f67dadd8d30abce42528da1b051db9836 100644
--- a/ash/shelf/shelf_button.cc
+++ b/ash/shelf/shelf_button.cc
@@ -315,8 +315,12 @@ void ShelfButton::ShowContextMenu(const gfx::Point& p,
destroyed_flag_ = nullptr;
// The menu will not propagate mouse events while its shown. To address,
// the hover state gets cleared once the menu was shown (and this was not
- // destroyed).
- ClearState(STATE_HOVERED);
+ // destroyed). In case context menu is shown target view does not receive
+ // OnMouseReleased events and we need to cancel capture manually.
+ if (shelf_view_->drag_view() == this)
+ OnMouseCaptureLost();
+ else
+ ClearState(STATE_HOVERED);
}
}
« no previous file with comments | « no previous file | ash/shelf/shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698