Secondary windows with height specified in pixels are wrong height (Bug #975)
1) On Nexus 4, run Testr
2) Select Notifications
3) Tap "Create system popup 16 gridunits tall"; observe that all eight lines of text are displayed.
4) Tap system popup to dismiss.
5) Tap "Create system popup 160px tall"; observe that only four lines of text are displayed.
On a Touchpad, both system popups are the same height. On a Pre 3 running webOS 2.2.4, both system popups are the same height. Thus, if height is specified in pixels, hardware pixels are being used, not CSS pixels, as expected.
That's because on TP 1 GridUnit = 10 pixel, but on N4 1 GridUnit = 18 pixels. So 160 pixels on TP = 16 GridUnits, however 16 GridUnits on N4 are 288 pixels, hence only 4 lines on the N4 with 160 pixels.
The implementation is correct, though it might not do what you would expect.
The "solution" would be to have the pixel value be dynamic for each device, so 160 on TP and 288 for N4.
Normally going forward we wouldn't use hard pixel values for these things anymore. Anywhere where it's still being used it should be converted to GridUnits (i.e. take TP pixel value / 10 and use the GridUnits value that we get). I recently converted the power menu in luna-systemui for this, hence it's now working properly on both N4 and TP ;)
When Testr is run on a Pre 3 running webOS 2.2.4, the "Create system popup 160px tall" button creates a system popup with all nine lines visible - that is, the popup is 160 device-independent pixels (DIPs) tall (240 physical pixels). [You need to use today's update (https://github.com/webOS-ports/org.webosports.app.testr/pull/23) to Testr for the text to be legible.]
Since webOS interprets the height parameter as DIPs, I think LuneOS should also, for compatability. As gridunits are not available on webOS devices, they are not a solution for apps that run on both.
Seems we need to use device pixel ratio as per http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html
Legacy uses Device Pixel Ratio across all elements in UI AFAIK. So I guess we'd need to apply the device pixel ratio to our "regular" pixels as well when not using Grid Units.
- Target version set to Medici
- Assignee set to Christophe Chapuis
- Status changed from New to In Progress
Yes, you're right, only the web content is scaled today with a pixel ratio by WebEngine. We should apply that ratio to the height when in pixel units.
This can be easily done here: https://github.com/webOS-ports/luna-webappmanager/blob/master/src/webapplication.cpp#L233
We need to make sure we have a layoutScale defined for the target device in it's luna-xxxx.conf file for luna-sysmgr.