Skip to content

Commit

Permalink
fix(XR): eagerly call sessionstart when late (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Oct 3, 2022
1 parent 8bfed03 commit 26220d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/XR.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ function XRManager({
session.addEventListener('visibilitychange', handleVisibilityChange)
session.addEventListener('inputsourceschange', handleInputSourcesChange)

// Eagerly call sessionstart when late
if (gl.xr.isPresenting) handleSessionStart({ type: 'sessionstart', target: session })

return () => {
gl.xr.removeEventListener('sessionstart', handleSessionStart)
gl.xr.removeEventListener('sessionend', handleSessionEnd)
Expand Down

0 comments on commit 26220d0

Please sign in to comment.