Closed
Bug 957490
Opened 10 years ago
Closed 10 years ago
MouseEvent.buttons property has incorrect value in WinRT/Metro
Categories
(Core Graveyard :: Widget: WinRT, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla29
People
(Reporter: mbrubeck, Assigned: mbrubeck)
References
Details
Attachments
(3 files, 1 obsolete file)
545 bytes,
text/html
|
Details | |
3.52 KB,
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
3.49 KB,
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
The "buttons" property of the "mousedown" event is not initialized correctly in Metro Firefox. You can see this in the attached test case. When you press a mouse button, it should display 1 for the left mouse button, 2 for the right button, 4 for the middle button, or a sum if you press multiple buttons. But on Metro it always displays zero, or only the previous button(s) if you press multiple buttons.
Assignee | ||
Comment 1•10 years ago
|
||
ModifierKeyState::InitMouseEvent is supposed to set the "buttons" property, but it uses ::GetKeyState which does not seem to be return up-to-date data in immersive mode. With this patch we call equivalent WinRT APIs instead when running in Metro mode.
Comment 2•10 years ago
|
||
Comment on attachment 8356978 [details] [diff] [review] patch >+ props->get_IsRightButtonPressed(&buttonPressed); >+ if (buttonPressed) >+ buttons |= WidgetMouseEvent::eRightButtonFlag; >+ >+ props->get_IsRightButtonPressed(&buttonPressed); >+ if (buttonPressed) >+ buttons |= WidgetMouseEvent::eRightButtonFlag; Duplicated the code for right button :-) And you should use {} for even if the content of a block is only one line. https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style#Control_Structures
Assignee | ||
Comment 3•10 years ago
|
||
Fixed the problems pointed out by Masayuki above. Thanks!
Attachment #8356978 -
Attachment is obsolete: true
Attachment #8356978 -
Flags: review?(jmathies)
Attachment #8357006 -
Flags: review?(jmathies)
Updated•10 years ago
|
Attachment #8357006 -
Flags: review?(jmathies) → review+
Assignee | ||
Comment 4•10 years ago
|
||
This is a simple mochitest for this bug plus bug 945438.
Attachment #8357308 -
Flags: review?(jmathies)
Assignee | ||
Comment 5•10 years ago
|
||
Comment on attachment 8357308 [details] [diff] [review] automated test Review of attachment 8357308 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/metro/base/tests/mochitest/browser_mouse_events.js @@ +6,5 @@ > +const leftButtonFlag = 1; > +const rightButtonFlag = 2; > + > +gTests.push({ > + desc: "native long tap works", Oops, copy/paste leftovers. Updated the description locally.
Updated•10 years ago
|
Attachment #8357308 -
Flags: review?(jmathies) → review+
Assignee | ||
Comment 6•10 years ago
|
||
Folded the two patches together and landed on fx-team: https://hg.mozilla.org/integration/fx-team/rev/d3ab07b86509
Flags: in-testsuite+
Comment 7•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d3ab07b86509
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Updated•5 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•