Closed Bug 745077 Opened 12 years ago Closed 12 years ago

Touch event is not correct when the orientation changes

Categories

(Core :: Widget, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: kanru, Assigned: kanru)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

STR:

 1. rotate the device (sgs2)
 2. the homescreen is in landscape mode
 3. but the touch events are still in portrait coordinate.
It looks like methods handling input coordinates need to consider current screen rotation and make adjustments accordingly. There is already a quick access to current rotation via nsScreenGonk, but width and height are problems. Querying screen manager seems not a good idea in such performance sensitive code.
Assignee: nobody → kchen
Attachment #616871 - Flags: review?(mwu)
Component: General → Widget
Product: Boot2Gecko → Core
QA Contact: general → general
Regression from bug 737199
Depends on: 737199
Keywords: regression
Comment on attachment 616871 [details] [diff] [review]
Bug 745077 - Reconfigure InputReader on screen rotation.

Review of attachment 616871 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good. r=me with the requested changes.

::: widget/gonk/nsAppShell.cpp
@@ +704,5 @@
>      write(signalfds[1], "w", 1);
>  }
>  
> +void
> +nsAppShell::NotifyScreenChangesInternal()

Inline this into NotifyScreenChanges. Also rename NotifyScreenChanges to NotifyScreenRotation.
Attachment #616871 - Flags: review?(mwu) → review+
(In reply to Michael Wu [:mwu] from comment #4)
> > +void
> > +nsAppShell::NotifyScreenChangesInternal()
> 
> Inline this into NotifyScreenChanges. Also rename NotifyScreenChanges to
> NotifyScreenRotation.

Hmm.. I need to access the private mReader. Do you want to expose gAppShell to nsWindow? 

NotifyScreenChanges does not only notify the orientation change but also the screen size change. But if you think NotifyScreenRotation fits here then I'm okay as well.
(In reply to Kan-Ru Chen [:kanru] from comment #5)
> (In reply to Michael Wu [:mwu] from comment #4)
> > > +void
> > > +nsAppShell::NotifyScreenChangesInternal()
> > 
> > Inline this into NotifyScreenChanges. Also rename NotifyScreenChanges to
> > NotifyScreenRotation.
> 
> Hmm.. I need to access the private mReader. Do you want to expose gAppShell
> to nsWindow? 
> 

NotifyScreenChanges is part of nsAppShell, so it should be able to access mReader, no?

> NotifyScreenChanges does not only notify the orientation change but also the
> screen size change. But if you think NotifyScreenRotation fits here then I'm
> okay as well.

Yeah, it's really the only reason why the screen size would change, so I think notifyscreenrotation is fine.
(In reply to Michael Wu [:mwu] from comment #6)
> > Hmm.. I need to access the private mReader. Do you want to expose gAppShell
> > to nsWindow? 
> > 
> 
> NotifyScreenChanges is part of nsAppShell, so it should be able to access
> mReader, no?

Oh, yes. So I will do gAppShell->mReader->... in it.
 
> > NotifyScreenChanges does not only notify the orientation change but also the
> > screen size change. But if you think NotifyScreenRotation fits here then I'm
> > okay as well.
> 
> Yeah, it's really the only reason why the screen size would change, so I
> think notifyscreenrotation is fine.

Got it.
https://hg.mozilla.org/mozilla-central/rev/26dbb2e9d91d
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: