Closed Bug 15307 Opened 25 years ago Closed 25 years ago

[PP] Mac: Key binding modifiers aren't respected on Mac

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P3)

PowerPC
Mac System 8.5
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: bugzilla, Assigned: Brade)

References

Details

Today with have some xul keyset to defined menu shortcut. if I have the following definition: <key id="key_newMessage" command="true" key="M;" observes="cmd_newMessage"/> If I type Command-m, newMessage is fired, Good. But it's also fired when I just type "m" You can see the problem with the message compose window. Every time to type "m" in the subject or in any of the recipient, a new compose window is created.
Severity: normal → blocker
Target Milestone: M11
It's so bad that every time you type 'n' or 'm' into any text field in the browser (url field or forms field) window, you get either a new browser ('n') or a new message compose ('m') window. For me it's a M11 blocker!
Assignee: joki → buster
The key event has garbage fields, specifically GetMetaKey returns garbage, causing keybinds to inappropriately fire. This is a bug in the Gfx text widget repropogation of the key event. I'm reassigning to buster
cc: paulmac.
The fix in my code is trivial, but there's a larger issue: I noticed this code in nsGUIEvent.h: 109 joki 3.13 struct nsInputEvent : public nsGUIEvent { 110 rods 3.8 /// PR_TRUE indicates the shift key in down 111 PRBool isShift; 112 /// PR_TRUE indicates the control key in down 113 PRBool isControl; 114 /// PR_TRUE indicates the alt key in down 115 PRBool isAlt; 116 pierre 3.24 #ifdef XP_MAC 117 /// PR_TRUE indicates the command key in down 118 /// For now, it's only used in Widget: not for export 119 /// in nsIDOMEvent.h or nsJSEvent.cpp (later maybe) 120 PRBool isCommand; 121 #endif 122 joki 3.13 }; The part that bothers me is the XP_MAC ifdef, since this is clearly XP code (and this is why I missed setting the isCommand variable, since I work on windows and didn't see it as an uninitialized variable in my purify runs. I don't see any reason why this should be #ifdef platform code. While the command is only settable on Mac, the extra few bytes are irrelevant because events are transient objects. In fact, I would make the 4 bools a single bit field, make the bit field protected, and add accessors and setters. Who owns this code?
Assignee: buster → brade
reassigning to Kathy based on this information... from Kipp: Fix it dude :-) Just make sure that if you init the bitfields, that you do something like this: class nsInputEvent : ... { public: struct ModeBits { PRUint32 isShift : 1; ...; }; protected: union { ModeBits mode; PRUint32 all; }; That way in your ctor you can init all the bits at once and keep purify happy...It happens to be more efficient too, which doesn't hurt. from Kathy: In fact, this code has been changed on the branch. The ifdef has been removed. Also, the field has been renamed to "isMeta" since that is more consistent with across platforms and across components.
Blocks: 15693
Target Milestone: M11 → M10
this is a go for M10...chofmann just approved...can we get this into the branch ASAP. Please contact leaf.
Blocks: 14742
Target Milestone: M10 → M11
Patch has been checked in the M10 branch last night. Now is just a M11 issue.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Keywords: verifyme
Mass update: changing qacontact to ckritzer@netscape.com
QA Contact: janc → ckritzer
Updating QA Contact.
QA Contact: ckritzer → lorca
Reassigning QA Contact for all open and unverified bugs previously under Lorca's care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok
QA contact updated
QA Contact: gerardok → madhur
verified on build 2001-08-07-08-trunk
Status: RESOLVED → VERIFIED
Keywords: verifyme
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.