Closed Bug 517658 Opened 15 years ago Closed 15 years ago

When adding MozOrientation listener, the listener is called only after there is orientation change

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: smaug, Assigned: smaug)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

I think this is a regression. We don't get the event somewhat soon after
adding the listener. And we should, so that web app can know the current
orientation.
At least on mac I need to wait several seconds before I get the first event (if I don't move the laptop).
Probably a regression from bug 512237, since that added the -1,1 checks.
This could be solved by adding values outside -1,1 or
setting values to be always within -1,1
Without this getting fixed, the event is pretty useless :(
Depends on: 513910
Attached patch patchSplinter Review
Attachment #401617 - Flags: review?(doug.turner)
we need to do at least what the patch does.
Or we can wait until bug 513910 is fixed.
I know in some bug I argued that this is not the right thing to do, and it isn't,
but at least it is better than current behavior :/
i would rather just drop the check complete (eg. fix 513910).
olli, do you want to post a patch that just removes that filtering and update the idl?
answered.
Comment on attachment 401617 [details] [diff] [review]
patch

lets to with this.  Maybe we should have a separate event that exposed actual force.
Attachment #401617 - Flags: review?(doug.turner)
Attachment #401617 - Flags: review+
Attachment #401617 - Flags: approval1.9.2?
Yeah, this is not perfect but works quite well in common cases.

Perhaps we could report avg of previous N accelerometer values to get
more "correct" orientation and have separate thing for force.

http://hg.mozilla.org/mozilla-central/rev/ced7e965f6dc
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Attachment #401617 - Flags: approval1.9.2? → approval1.9.2+
Assignee: nobody → Olli.Pettay
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: