Closed
Bug 235966
Opened 22 years ago
Closed 21 years ago
nsMenuBarListener.cpp opens the menu on Ctrl+Alt+T
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
People
(Reporter: jwkbugzilla, Assigned: jwkbugzilla)
Details
(Keywords: regression)
Attachments
(2 files, 3 obsolete files)
|
3.54 KB,
patch
|
Details | Diff | Splinter Review | |
|
8.12 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent:
Build Identifier:
The problem can be tested with Linux and it will occur on Windows as well - as
soon as bug 197474 is fixed (see comment 42 there). The Tools menu opens on the
key combination Alt+T, but it opens on Ctrl+Alt+T as well.
The reason is in the method KeyPress:
http://lxr.mozilla.org/mozilla/source/layout/xul/base/src/nsMenuBarListener.cpp#234
232 // If charCode == 0, then it is not a printable character.
233 // Don't attempt to handle accesskey for non-printable characters
234 if (IsAccessKeyPressed(keyEvent) && charCode)
235 {
IsAccessKeyPressed() doesn't check whether other modifier keys are down or not.
The easiest solution is probably making IsAccessKeyPressed() check other keys,
something like this (mostly copy&paste from KeyDown):
PRBool
nsMenuBarListener::IsAccessKeyPressed(nsIDOMKeyEvent* aKeyEvent)
{
PRBool access = PR_FALSE;
// No other modifiers can be down (SHIFT is ok here).
// Especially CTRL. CTRL+ALT == AltGR, and
// we'll fuck up on non-US enhanced 102-key
// keyboards if we don't check this.
PRBool ctrl = PR_FALSE;
if (mAccessKey == nsIDOMKeyEvent::DOM_VK_CONTROL)
keyEvent->GetCtrlKey(&access);
else
keyEvent->GetCtrlKey(&ctrl);
PRBool alt=PR_FALSE;
if (mAccessKey == nsIDOMKeyEvent::DOM_VK_ALT)
keyEvent->GetAltKey(&access);
else
keyEvent->GetAltKey(&alt);
PRBool meta=PR_FALSE;
if (mAccessKey == nsIDOMKeyEvent::DOM_VK_META)
keyEvent->GetMetaKey(&access);
else
keyEvent->GetMetaKey(&meta);
if (ctrl || alt || meta)) {
return PR_FALSE;
} else {
return access;
}
}
Reproducible: Always
Steps to Reproduce:
1. Open Mozilla under Linux and press Ctrl+Alt+T
Actual Results:
The Tools menu opens.
Expected Results:
The menu shouldn't open.
Updated•22 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Updated•22 years ago
|
Assignee: hyatt → trev
Status: ASSIGNED → NEW
| Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•22 years ago
|
||
Added a function GetModifiers() to get all modifiers of the event in a single
value - makes modifier checking much easier. Fixed the modifier check for menu
shortcuts, only Shift is allowed to be down now.
| Assignee | ||
Updated•22 years ago
|
Attachment #142997 -
Flags: review?(hyatt)
| Assignee | ||
Updated•22 years ago
|
Attachment #142997 -
Flags: review?(hyatt) → review?(varga)
Updated•22 years ago
|
Keywords: regression
Comment 2•22 years ago
|
||
Comment on attachment 142997 [details] [diff] [review]
Proposed patch
Looks good
r=varga
Attachment #142997 -
Flags: review?(varga) → review+
| Assignee | ||
Comment 3•22 years ago
|
||
The old patch bitrottened, here the new version of the same thing.
| Assignee | ||
Updated•22 years ago
|
Attachment #142997 -
Attachment is obsolete: true
| Assignee | ||
Updated•22 years ago
|
Attachment #153308 -
Flags: superreview?(hyatt)
Attachment #153308 -
Flags: review+
| Assignee | ||
Updated•22 years ago
|
Attachment #153308 -
Flags: superreview?(hyatt) → superreview?(bryner)
| Assignee | ||
Updated•22 years ago
|
Severity: normal → major
| Assignee | ||
Comment 4•21 years ago
|
||
Since bug 197474 has been fixed this matter is urgent now. The menus are
reacting to shortcuts they shouldn't get and this is a major annoyance. I don't
know why nobody complained before as this existed on Linux for years but Windows
users won't be that silent. I think this bug should be fixed as soon as possible
to get some testing even before the beta version comes out. Marking it
blocking1.8a3?
Flags: blocking1.8a3?
Comment 5•21 years ago
|
||
We're not going to hold the release for this but if it gets the proper reviews
in time for inclusion in 1.8a3, please request landing approval.
Flags: blocking1.8a3? → blocking1.8a3-
Updated•21 years ago
|
Attachment #153308 -
Flags: superreview?(bryner) → superreview+
| Assignee | ||
Updated•21 years ago
|
Attachment #153308 -
Flags: approval1.8a3?
Comment 6•21 years ago
|
||
Comment on attachment 153308 [details] [diff] [review]
Updated patch
unsetting 1.8a3 approval request. we've shipped already.
Attachment #153308 -
Flags: approval1.8a3?
| Assignee | ||
Comment 7•21 years ago
|
||
| Assignee | ||
Comment 8•21 years ago
|
||
Forgot one file...
| Assignee | ||
Updated•21 years ago
|
Attachment #156491 -
Attachment is obsolete: true
Comment on attachment 153308 [details] [diff] [review]
Updated patch
mozilla/layout/xul/base/src/nsMenuBarListener.h 1.20
mozilla/layout/xul/base/src/nsMenuBarListener.cpp 1.71
Attachment #153308 -
Attachment is obsolete: true
| Assignee | ||
Comment 10•21 years ago
|
||
This is the patch that timeless checked in (slightly changed because of a
conflict). Then the patch in attachment 156492 [details] [diff] [review] had to be applied additionally
to fix the bustage.
| Assignee | ||
Comment 11•21 years ago
|
||
The bug doesn't occur in nightly build 2004081908 anymore, marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•