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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js

Issue 2469813005: DevTools: throttle calls to ToolbarMenuButton.trigger() to avoid bad context menu state on Mac (Closed)
Patch Set: DevTools: throttle calls to ToolbarMenuButton.trigger() to avoid bad context menu state Created 4 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
index cf8fa00496ce10a0b13f27bba42c2a221a6e0ff1..cc0645ffa7f83f29ab17de60bc3f31a808dd8218 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
@@ -657,11 +657,17 @@ WebInspector.ToolbarMenuButton = class extends WebInspector.ToolbarButton {
*/
_trigger(event) {
delete this._triggerTimeout;
+
+ // Throttling avoids entering a bad state on Macs when rapidly triggering context menus just
+ // after the window gains focus. See crbug.com/655556
+ if (this._lastTriggerTime && Date.now() - this._lastTriggerTime < 300)
+ return;
var contextMenu = new WebInspector.ContextMenu(
event, this._useSoftMenu, this.element.totalOffsetLeft(),
this.element.totalOffsetTop() + this.element.offsetHeight);
this._contextMenuHandler(contextMenu);
contextMenu.show();
+ this._lastTriggerTime = Date.now();
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698