Skip to content

Commit c09dd55

Browse files
committed
Bug 282097 - Part 1: Add mNativeKeyEvent to nsKeyEvent. r=masayuki
1 parent 85bc4fa commit c09dd55

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

widget/nsGUIEvent.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,8 @@ class nsKeyEvent : public nsInputEvent
10761076
: nsInputEvent(isTrusted, msg, w, NS_KEY_EVENT),
10771077
keyCode(0), charCode(0),
10781078
location(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD), isChar(0),
1079-
mKeyNameIndex(mozilla::widget::KEY_NAME_INDEX_Unidentified)
1079+
mKeyNameIndex(mozilla::widget::KEY_NAME_INDEX_Unidentified),
1080+
mNativeKeyEvent(nullptr)
10801081
{
10811082
}
10821083

@@ -1093,6 +1094,8 @@ class nsKeyEvent : public nsInputEvent
10931094
bool isChar;
10941095
// DOM KeyboardEvent.key
10951096
mozilla::widget::KeyNameIndex mKeyNameIndex;
1097+
// OS-specific native event can optionally be preserved
1098+
void* mNativeKeyEvent;
10961099

10971100
void GetDOMKeyName(nsAString& aKeyName)
10981101
{

widget/nsGUIEventIPC.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ struct ParamTraits<nsKeyEvent>
258258
WriteParam(aMsg, aParam.charCode);
259259
WriteParam(aMsg, aParam.isChar);
260260
WriteParam(aMsg, aParam.location);
261+
// An OS-specific native event might be attached in |mNativeKeyEvent|, but
262+
// that cannot be copied across process boundaries.
261263
}
262264

263265
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)

0 commit comments

Comments
 (0)