Closed
Bug 812351
Opened 12 years ago
Closed 11 years ago
[metro] Insure pointer/keyboard input is delivered to windowless plugins
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jimm, Assigned: TimAbraldes)
References
Details
(Whiteboard: [metro-it1][metro-it2])
Attachments
(3 files, 5 obsolete files)
13.52 KB,
patch
|
mbrubeck
:
review+
|
Details | Diff | Splinter Review |
22.77 KB,
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
7.09 KB,
patch
|
TimAbraldes
:
review+
|
Details | Diff | Splinter Review |
Since we are doing a lot of work on widget input currently, filing this to be sure we have the basics working for windowless plugins: - precise/keyboard input events need to be delivered properly - touch input should get translated to precise input initially We want to emulate desktop event system as much as possible here. Windowless plugins receive standard win32 windowing events for this stuff, so we need to figure out how this is going to be connected up to the winrt widget backend. We should also leverage existing / or write new tests for this using the test plugin, and get the test plugin enabled in metro mode.
Reporter | ||
Updated•12 years ago
|
Summary: [metro] Insure pointer input is delivered to windowless plugins → [metro] Insure pointer/keyboard input is delivered to windowless plugins
Assignee | ||
Comment 1•12 years ago
|
||
I'll take a look at this for metro-it1
Status: NEW → ASSIGNED
QA Contact: tabraldes
Whiteboard: [metro-it1]
Assignee | ||
Comment 2•12 years ago
|
||
Looks like I managed to set myself as the QA contact instead of the assignee. Fixing that.
Assignee: nobody → tabraldes
QA Contact: tabraldes
Assignee | ||
Comment 3•12 years ago
|
||
This hasn't been tested yet, but the code is pretty straightforward to write after the work in bug 817061
Assignee | ||
Updated•12 years ago
|
Whiteboard: [metro-it1] → [metro-it1][metro-it2]
Assignee | ||
Comment 4•12 years ago
|
||
Just a quick update: I tested this patch by enabling plugins in metro (plugin.disable = false) then going to a website that uses Flash. I was able to interact with the Flash content using the mouse. Typing characters didn't work, likely due to the fact that this patch sends WM_UNICHAR messages but doesn't send WM_CHAR messages.
Assignee | ||
Comment 5•12 years ago
|
||
I "tested" this patch by going to Kongregate and playing a couple of the games. First set "plugin.disable=false" Mouse and keyboard input are both working. Still TODO: Handle Unicode characters that don't fit into a single UTF-16 character Figure out why only left-mouse-button seems to be working (it's possible that we're correctly sending WM_RBUTTONDOWN but that flash can't do what it normally does) Misc cleanup
Attachment #691175 -
Attachment is obsolete: true
Reporter | ||
Comment 6•11 years ago
|
||
Do we have event simulation calls such that we can write tests that send touch input that gets translated and picked up by the test plugin? See bug 806523 for an example mochitest-metro-chrome test that uses the test plugin.
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #6) > Do we have event simulation calls such that we can write tests that send > touch input that gets translated and picked up by the test plugin? We cannot yet simulate touch input; only mouse and keyboard input. > See bug 806523 for an example mochitest-metro-chrome test that uses the test > plugin. Thanks for the link! This afternoon I'll be posting an updated patch for review and attempting to write some tests for this patch that utilize the test plugin
Assignee | ||
Comment 8•11 years ago
|
||
I'm currently working on the tests for this change (and won't submit without them) but I think this much is ready for review. A fun way to test this patch is to set "plugin.disable = false" and simply enjoy Youtube.
Attachment #694613 -
Attachment is obsolete: true
Attachment #699502 -
Flags: review?(jmathies)
Reporter | ||
Comment 9•11 years ago
|
||
Comment on attachment 699502 [details] [diff] [review] Patch v3 Review of attachment 699502 [details] [diff] [review]: ----------------------------------------------------------------- Looks great! ::: widget/windows/winrt/MetroInput.cpp @@ +172,5 @@ > + // WM_KEYDOWN > + // /en-us/library/windows/desktop/ms646280%28v=vs.85%29.aspx > + // > + // WM_KEYUP > + // /en-us/library/windows/desktop/ms646281%28v=vs.85%29.aspx nit - these uris break over time, and everybody knows how to punch something into google so, lets ditch the msdn links in comments headers. :) @@ +256,5 @@ > + // /en-us/library/windows/desktop/ms646242%28v=vs.85%29.aspx > + // WM_MOUSEHWHEEL > + // /en-us/library/windows/desktop/ms645614%28v=vs.85%29.aspx > + // WM_MOUSEWHEEL > + // /en-us/library/windows/desktop/ms645617(v=vs.85).aspx nit - same here.
Attachment #699502 -
Flags: review?(jmathies) → review+
Assignee | ||
Comment 10•11 years ago
|
||
Un-bitrotted patch. This is different enough that I think I'd like you to take another look at it, jimm.
Attachment #699502 -
Attachment is obsolete: true
Attachment #709178 -
Flags: review?(jmathies)
Assignee | ||
Comment 11•11 years ago
|
||
This patch contains a bunch of helper functions that I needed for writing the plugin input tests. It also removes helpers that aren't being used anywhere in our mochitests.
Attachment #709181 -
Flags: review?(mbrubeck)
Assignee | ||
Comment 12•11 years ago
|
||
I'm not sure which of you is a more appropriate reviewer for the plugin input tests.
Attachment #709182 -
Flags: review?(mbrubeck)
Attachment #709182 -
Flags: review?(jmathies)
Reporter | ||
Comment 13•11 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #9) > Comment on attachment 699502 [details] [diff] [review] > Patch v3 > > Review of attachment 699502 [details] [diff] [review]: > ----------------------------------------------------------------- > > Looks great! > > ::: widget/windows/winrt/MetroInput.cpp > @@ +172,5 @@ > > + // WM_KEYDOWN > > + // /en-us/library/windows/desktop/ms646280%28v=vs.85%29.aspx > > + // > > + // WM_KEYUP > > + // /en-us/library/windows/desktop/ms646281%28v=vs.85%29.aspx > > nit - these uris break over time, and everybody knows how to punch something > into google so, lets ditch the msdn links in comments headers. :) > > @@ +256,5 @@ > > + // /en-us/library/windows/desktop/ms646242%28v=vs.85%29.aspx > > + // WM_MOUSEHWHEEL > > + // /en-us/library/windows/desktop/ms645614%28v=vs.85%29.aspx > > + // WM_MOUSEWHEEL > > + // /en-us/library/windows/desktop/ms645617(v=vs.85).aspx > > nit - same here. did you miss addressing these nits?
Comment 14•11 years ago
|
||
Comment on attachment 709181 [details] [diff] [review] Testing Helpers v1 Review of attachment 709181 [details] [diff] [review]: ----------------------------------------------------------------- Awesome work! I'm starting to want to use some of these (like waitForEvent) in chrome also; we should think about putting the most useful ones into a JS module in toolkit. ::: browser/metro/base/tests/head.js @@ +98,5 @@ > + * > + * @param aMs the number of miliseconds to wait for > + * @returns a Promise that resolves to true after the time has elapsed > + */ > +function waitForMs(aMs) { I notice there's an equivalent task function here: http://mxr.mozilla.org/mozilla-central/source/toolkit/modules/tests/xpcshell/test_sqlite.js#18 Another reason to create a shared task library...
Attachment #709181 -
Flags: review?(mbrubeck) → review+
Comment 15•11 years ago
|
||
Comment on attachment 709182 [details] [diff] [review] Plugin Input tests v1 Review of attachment 709182 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me. Some minor style hints below, from the unwritten Fennec style guide which mfinkle has passed down to me as oral tradition. ::: browser/metro/base/tests/browser_plugin_input_keyboard.js @@ +10,5 @@ > + desc: "Plugin keyboard input", > + run: function() { > + let oldPrefPluginDisable = Services.prefs.getBoolPref("plugin.disable"); > + let oldPrefPluginsClickToPlay = > + Services.prefs.getBoolPref("plugins.click_to_play"); No need for wrapping here. (We have no strict line-length limits in /browser/metro, though wrapping somewhere around 100-120 columns is appreciated.) You can similarly un-wrap several other lines in this file. @@ +16,5 @@ > + Services.prefs.setBoolPref("plugins.click_to_play", false); > + registerCleanupFunction( > + Services.prefs.setBoolPref.bind(null, > + "plugin.disable", > + oldPrefPluginDisable)); You can use Services.prefs.clearUserPref here, so you don't need to store the old value. @@ +46,5 @@ > + keyCode: 65, > + modifiers: rightAlt, > + expectedChar: "á" }]; > + > + while(keys.length > 0) { Nit: space after keywords like "while" or "if" (purely for consistency). ::: browser/metro/base/tests/browser_plugin_input_mouse.js @@ +16,5 @@ > + Services.prefs.setBoolPref("plugins.click_to_play", false); > + registerCleanupFunction( > + Services.prefs.setBoolPref.bind(null, > + "plugin.disable", > + oldPrefPluginDisable)); See above. @@ +63,5 @@ > + synthesizeNativeMouseLDown(plugin, click.x, click.y); > + synthesizeNativeMouseLUp(plugin, click.x, click.y); > + let success = yield waitForCondition(testMouseUpCount.bind(null, > + plugin, > + curClicks)); I think this would be clearer to me if the condition function were just placed inline here. Up to you if you want to make this change.
Attachment #709182 -
Flags: review?(mbrubeck) → review+
Assignee | ||
Comment 16•11 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #13) > (In reply to Jim Mathies [:jimm] from comment #9) > > Comment on attachment 699502 [details] [diff] [review] > > Patch v3 > > > > Review of attachment 699502 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > Looks great! > > > > ::: widget/windows/winrt/MetroInput.cpp > > @@ +172,5 @@ > > > + // WM_KEYDOWN > > > + // /en-us/library/windows/desktop/ms646280%28v=vs.85%29.aspx > > > + // > > > + // WM_KEYUP > > > + // /en-us/library/windows/desktop/ms646281%28v=vs.85%29.aspx > > > > nit - these uris break over time, and everybody knows how to punch something > > into google so, lets ditch the msdn links in comments headers. :) > > > > @@ +256,5 @@ > > > + // /en-us/library/windows/desktop/ms646242%28v=vs.85%29.aspx > > > + // WM_MOUSEHWHEEL > > > + // /en-us/library/windows/desktop/ms645614%28v=vs.85%29.aspx > > > + // WM_MOUSEWHEEL > > > + // /en-us/library/windows/desktop/ms645617(v=vs.85).aspx > > > > nit - same here. > > did you miss addressing these nits? Oops! I certainly did! Attaching new patch
Attachment #709178 -
Attachment is obsolete: true
Attachment #709178 -
Flags: review?(jmathies)
Attachment #709224 -
Flags: review?(jmathies)
Reporter | ||
Updated•11 years ago
|
Attachment #709224 -
Flags: review?(jmathies) → review+
Reporter | ||
Comment 17•11 years ago
|
||
Comment on attachment 709182 [details] [diff] [review] Plugin Input tests v1 no need for a review from me, mbrubeck is far more qualified to review front end work.
Attachment #709182 -
Flags: review?(jmathies)
Assignee | ||
Comment 18•11 years ago
|
||
Attachment #709182 -
Attachment is obsolete: true
Attachment #709255 -
Flags: review+
Assignee | ||
Comment 19•11 years ago
|
||
Landed on elm: Test helpers - https://hg.mozilla.org/projects/elm/rev/f07961894b62 Patch - https://hg.mozilla.org/projects/elm/rev/9a89257abb4e Tests - https://hg.mozilla.org/projects/elm/rev/bd3a90f08a72 First build with these patches: https://tbpl.mozilla.org/?tree=Elm&rev=bd3a90f08a72
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
OS: Windows 8 Metro → Windows 8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•