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

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

Issue 2492523003: DevTools: throttle calls to ToolbarMenuButton.trigger() to avoid bad context menu state on Mac (Closed)
Patch Set: 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 94a5c81b832727fb6a92c82f297dc23a4f9885e2..261790ff85017d412145b1c7b935bce4f86ad647 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
@@ -715,12 +715,18 @@ WebInspector.ToolbarMenuButton.prototype = {
_trigger: function(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