While WebVR is enabled, Gamepad API can report no gamepads briefly when console is opened
Categories
(Core :: WebVR, enhancement, P2)
Tracking
()
People
(Reporter: kevin, Unassigned)
Details
Additionally, the "gamepadconnected" event fires every time the console is re-opened, but "gamepaddisconnected" does not.
Repro:
Tested with Vive controllers, but possibly occurring with other devices as well.
- Go to: https://webvr.info/samples/XX-vr-controllers.html
- Enter VR with controllers connected.
- in the console, enter the following:
setInterval(() => {
console.log(navigator.getGamepads().length)
}, 0);
window.addEventListener("gamepaddisconnected", () => {
console.log("disconnected");
});
window.addEventListener("gamepadconnected", () => {
console.log("connected");
});
- Repeatedly open and close the console.
- Observe that "connected" will repeatedly fire when opening the console, and that the gamepad length will sometimes report as "0" briefly. See screenshot below:
https://i.gyazo.com/9c33208d6aaf6965a3c092ed990379ba.png
Expectation:
If it is intended that the gamepads be reconnected when opening the console, then "gamepaddisconnected" should correctly fire. Otherwise, the gamepads should remain connected and "gamepadconnected" should not fire.
Tested on both 68 and 70.
![]() |
||
Updated•6 years ago
|
Updated•6 years ago
|
![]() |
||
Comment 1•6 years ago
|
||
I would like to give this "Enhancement" tag because it only happens in Console window and that are mostly for developers.
![]() |
||
Comment 3•6 years ago
|
||
(In reply to :Harald Kirschner :digitarald from comment #2)
Daosheng, could DevTools help with this?
That would be great if DevTools can jump into this bug. I would guess if Dev tool is running at an individual process and GamepadManager
doesn't construct IPC connection with it properly.
![]() |
||
Comment 4•6 years ago
|
||
I would guess if Dev tool is running at an individual process
DevTools is on main process.
GamepadManager doesn't construct IPC connection with it properly.
The IPC issue you describe sounds rather like this issue is in the GamepadManager
and not DevTools? Can you elaborate, so I can ni? the right team?
![]() |
||
Comment 5•6 years ago
|
||
(In reply to :Harald Kirschner :digitarald from comment #4)
I would guess if Dev tool is running at an individual process
DevTools is on main process.
GamepadManager doesn't construct IPC connection with it properly.
The IPC issue you describe sounds rather like this issue is in the
GamepadManager
and not DevTools? Can you elaborate, so I can ni? the right team?
Navigator and GamepadManager are running at the content process. GamepadManager tells nsGlobalWindow how many gamepads it has. The controller information comes from VRManager, it runs at the main process and queries VR hardware related information, and notify the content process via IPC.
GamepadManager will remove all gamepads and ask for re-query current available VR controllers from VRManager when there is no other global windows are using GamepadManager and users ask for refreshing a gamepad page.
![]() |
||
Comment 6•6 years ago
|
||
Any idea what could be going on here with Console and VRManager/GamepadManager?
Comment 7•6 years ago
|
||
I don't have controllers so I can't tell (you can send me a HTC Vive whenever you want :D )
I really don't see why the console would have any impact on this.
Here the code from Comment 0 simply add event listeners, like a script would do.
Kevin, could you set a test page where you put the events listeners in the page itself (not in console) and check if you get different results?
Hi sorry for the really long delay on this- I don't use Bugzilla much. Went ahead and and put together a simple glitch example as requested: https://glitch.com/edit/#!/blue-mozzarella (note that this uses A-Frame to handle the "Enter VR" part). Same results occur when following the original repro steps.
Updated•5 years ago
|
Comment 9•4 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months.
:jimm, could you have a look please?
For more information, please visit auto_nag documentation.
![]() |
||
Updated•3 years ago
|
Description
•