From 2a57525bbbbe0867286a60455a8a31005c794557 Mon Sep 17 00:00:00 2001 From: "mozilla.mano%sent.com" Date: Wed, 22 Aug 2007 05:03:33 +0000 Subject: [PATCH] Bug 299706 - When a tab is focused, cmd+right/left-arrow drags it and goes back/forward. r=mconnor, a=chase. --- browser/base/content/tabbrowser.xml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index dbc6ef36d23..4b72a050759 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1876,11 +1876,15 @@ // Don't let untrusted events mess with tabs. return; } - + + if (('shiftKey' in aEvent && aEvent.shiftKey) || + ('altKey' in aEvent && aEvent.altKey)) + return; #ifdef XP_MACOSX if ('metaKey' in aEvent && aEvent.metaKey) { #else - if ('ctrlKey' in aEvent && aEvent.ctrlKey) { + if (('ctrlKey' in aEvent && aEvent.ctrlKey) && + !('metaKey' in aEvent && aEvent.metaKey)) { if (aEvent.keyCode == KeyEvent.DOM_VK_F4 && this.tabbrowser.mTabBox.handleCtrlPageUpDown) { this.tabbrowser.removeCurrentTab(); @@ -1906,8 +1910,12 @@ this.tabbrowser.moveTabToEnd(); break; default: - break; + // Stop the keypress event for the above keyboard + // shortcuts only. + return; } + aEvent.stopPropagation(); + aEvent.preventDefault(); } } }