Closed Bug 930306 Opened 6 years ago Closed 6 years ago

[Flatfish][Homescreen] grid icons shift to wrong page

Categories

(Firefox OS Graveyard :: Gaia::Homescreen, defect)

Other
Gonk (Firefox OS)
defect
Not set

Tracking

(blocking-b2g:1.3+)

RESOLVED FIXED
blocking-b2g 1.3+

People

(Reporter: gasolin, Assigned: gasolin)

References

Details

(Whiteboard: [Flatfish only] [developer+])

Attachments

(3 files)

followup bug 921327 (Screenshot attached)

while test on real device I found the strange behavior that after swipe right then left to the first screen, the icons are not hidden correctly. (it not happens on nightly)

it's only for flatfish. With or without bug 921327 applied
Blocks: flatfish
Depends on: 921327
Summary: [Flatfish][Homescreen] after swipe page, icons not hide correctly in first page & 3rd page → [Flatfish][Homescreen] after swipe page, icons not hide correctly in first page & 3rd page in real device
Assignee: nobody → gasolin
We use below value to translate each page; however, the value currently is actually portrait's windowWidth in the beginning when we unlock the screen ..
https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/js/grid.js#L28
while boot on real device, homescreen's width&height value are mixed

window.innerWidth got 800, (should be 1260)
window.innerHeight got 1260, (should be 800)

Both reproducible in 1.2 or master.
Not sure is it related to handle default in gaia system or in gecko.

@alive, @viral, any thought?
Flags: needinfo?(vwang)
Flags: needinfo?(alive)
sorry, window.innerWidth should be 1280,
window.innerHeight should be 780 in landscape
blocking-b2g: --- → koi?
What does the UI look like?
Flags: needinfo?(alive)
1st kind of issue is https://bug921327.bugzilla.mozilla.org/attachment.cgi?id=820862
It caused by wrong window.innerWidth. change variable that use this value to 1280 could fix this issue.

2nd issue could be found after restart the device.
The screen will be 'cut' and the screen only react within 800px width region. Open any app then back to homescreen could back to normal.
Summary: [Flatfish][Homescreen] after swipe page, icons not hide correctly in first page & 3rd page in real device → [Flatfish][Homescreen] get wrong window.innerWidth/window.innerHeight that cause grid icons shift to wrong page
Summary: [Flatfish][Homescreen] get wrong window.innerWidth/window.innerHeight that cause grid icons shift to wrong page → [Flatfish][Homescreen] get wrong window.innerWidth/.innerHeight which cause grid icons shift to wrong page
Assignee: gasolin → nobody
Duplicate of this bug: 932662
ni? Bruce for flatfish on v1.2 or v1.3
Flags: needinfo?(bhuang)
I check the data from nsGlobalWindow.cpp, it looks like the information is correct.
In homescreen, window.innerWidth is 1280 and window.innerHeight is 800.

I've check the code in homescreen, sometimes it will used the variable "windowWidth" which assigned once.
https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/js/grid.js#L40

I'm not sure if it needs consider the orientation change case.
I try to replace all the "windowWidth" to "window.innerWidth" to make sure we can have the updated data, it looks more likely as our expect.
Attached the picture as below:
https://www.dropbox.com/s/jymdo2yn2ak61mu/IMAG0532.jpg
Flags: needinfo?(vwang)
viral, thanks for check this issue.

in 2nd issue, if we restart the device, the screen will only react within 800px width region.
It happens even if We replaced all windowWidth to 1280. Do you have any idea for it?
Flags: needinfo?(vwang)
Thanks for your demo again for 2nd issue.

I didn't have any of idea so far but can only found TWCI server didn't have this issue which is really weird.
Try to make the same commit with TWCI to see what we can do next.
Flags: needinfo?(vwang)
Hi viral,

I just flashed with 11/5 gecko/gaia and can reproduced the 2nd issue...
Attached image homescreen3.png
Gaia:     51e80edcfb40082793e1f3219fc1fe2729f338f9
Gecko:    b6a4edc4e3778d3844752c8998debb930890eb20
BuildID   20131105100731
Version   28.0a1
Attached image homescreen4.png
Also, the dock is gone.
dive into system and found some clue,

(O) in system/js/orientation_manager.js:31 it reports w:1280 h:800 and landscape-primary
(O) in system/js/screenshot.js:19 it reports w:1280 h:800
(x) in system/js/window.js AppWindow resize it reports *w:800 h:1280* 

w/h denotes window.innerWidth/.innerHeight

Not sure which factor change the width/height in AppWindow.prototype.resize
Depends on: 908601
Flags: needinfo?(alive)
update: at start time, AppWindow.resize will report *w:800 h:1280* at first time, then change back to w:1280 h:800

logcat result:

I/GeckoDump( 2714): XXX FIXME : Got a mozContentEvent: force-update-check
E/GeckoConsole( 2714): Content JS LOG at app://system.gaiamobile.org/js/window.js:607 in aw_resize: XXX resize w:800 h:1280
E/GeckoConsole( 2714): Content JS LOG at app://system.gaiamobile.org/js/window.js:607 in aw_resize: XXX resize w:1280 h:800
E/GeckoConsole( 2714): Content JS LOG at app://system.gaiamobile.org/js/window.js:607 in aw_resize: XXX resize w:1280 h:800
E/GeckoConsole( 2714): Content JS LOG at app://system.gaiamobile.org/js/window.js:607 in aw_resize: XXX resize w:1280 h:800
E/GeckoConsole( 2714): Content JS LOG at app://system.gaiamobile.org/js/window.js:607 in aw_resize: XXX resize w:1280 h:800
Depends on: 934906
2nd issue still spotted even provide fixed width/height in homescreen. I think it's gecko bug.
could be discussed in bug 934906
I also try to lock orientation in apps/homescreen/js/homescreen.js with this api:

window.screen.mozLockOrientation("default");

and remove the "orientation": "default" in apps/homescreen/manifest.webapp

It looks like the 2nd kind of issue is gone.
No longer depends on: 934906
Depends on: 934906
Does this mean ScreenLayout.defaultOrientation or OrientationManager.defaultOrientation is not landscape?
Does https://github.com/mozilla-b2g/gaia/blob/v1.2/apps/system/js/window.js#L450 is called on launching homescreen?
Flags: needinfo?(alive)
OrientationManager.defaultOrientation is landscape-primary
AppWindow.setOrientation is called once and the value is 'default'.

after change via Comment 17, the 2nd issue is mitigated (but still can be spot at very short time).
But many side effect happens (the orientation lock not work perperly...)
Whiteboard: [Flatfish only] [developer+]
Duplicate of this bug: 935323
Summary: [Flatfish][Homescreen] get wrong window.innerWidth/.innerHeight which cause grid icons shift to wrong page → [Flatfish][Homescreen] grid icons shift to wrong page
Seems the reason is system in 'globalorientationchanged' stat change the orientation to portrait-primary, which cause homescreen grid get wrong width
Attachment #828489 - Flags: review?(alive)
clear blocking flag until we have clarity for flatfish
blocking-b2g: koi? → ---
Comment on attachment 828489 [details] [review]
pull request redirect to github

See github
Attachment #828489 - Flags: review?(alive) → review+
update & merged to gaia-master https://github.com/mozilla-b2g/gaia/commit/27386c08848c3420f496d652da15d46225788144

thanks!
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(bhuang)
Resolution: --- → FIXED
blocking-b2g: --- → 1.3+
Assignee: nobody → gasolin
You need to log in before you can comment on or make changes to this bug.