Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3058] Android: If heavyweight window's JS code immediately opens a lightweight window, lightweight window is never seen

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:00:48.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M09
ComponentsAndroid
Labelsandroid, defect, lifecycle_refactor, regression, release-1.6.0, reported-1.6.0, rplist
ReporterBill Dawson
AssigneeBill Dawson
Created2011-04-15T03:35:46.000+0000
Updated2011-04-17T02:00:48.000+0000

Description

The fail case is the KS -> Controls -> Slider -> Min/Max Range test. When you run it, you only see a black window.

It's a very strangely written test, and I'm pretty sure it's actually a mistake (the way it's written). (Nevertheless, it should -- and did -- work.)

It's strange because when you tap the row to start the test, it opens a new window (as do basically all of our KS tests) using tabgroup.open(win) (thus that new window is heavy). That window has its own url property. And in the JS of that URL, a second window (light) is created and opened in order to display the test. (This second window is obviously totally unnecessary, but anyway...)

The reason we see a blank window is because it's the heavy window that is showing. (The JS for the heavy window does not contain any code that puts a view on the window.) The lightweight window never gets seen. And we can see why in this screen shot of some logcat output that I've annotated:

https://skitch.com/billdawson/rpdeu/projects-grep-137x29">https://skitch.com/billdawson/rpdeu/projects-grep-137x29

So when the lightweight window starts opening, the heavyweight window hasn't finished opening yet (obviously, since part of the code running when the heavyweight window opens is to open the lightweight window.) And when a lightweight window is created (constructor of TiUIWindow), it immediately runs through handleWindowCreated and handleBooted, thus putting out its layout right away. Meanwhile the heavyweight window has to wait until its handleBooted gets called. When it does, the heavyweight window puts its layout on the activity, thus hiding the lightweight window's layout.

So the test is bizarre and probably should be changed. But the use case of having a heavy open a light immediately is perhaps valid. Like maybe the heavy's code checks some condition and if it exists they want to popup a light window for a second to display an elaborate message with an OK button that closes the light so its re-shows the heavy.

'N' stuff, and yeah but no but yeah but no.

Comments

  1. Bill Dawson 2011-04-15

    (from [1e82b2497cc81acafb60841154e3ba1e82744677]) [#3058 state:fixed-in-qa] in TiBaseActivity.onCreate, set the window handler so that any lightweight windows drawn in heavyweight window's JS will be visible. https://github.com/appcelerator/titanium_mobile/commit/1e82b2497cc81acafb60841154e3ba1e82744677"> https://github.com/appcelerator/titanium_mobile/commit/1e82b2497cc8...

  2. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.6.0 (02/08/11 20:55 bd9d124...) galaxy tab (2.2.2) G1 (1.6) Nexus S (2.3) sim 2.1

JSON Source