initial WebView geometry incorrect when launched on screen with dynamic grid units

Bug #1575216 reported by Gerry Boland on 2016-04-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Critical
David Barth
Oxide
Critical
Chris Coulson
1.14
Critical
Chris Coulson
1.15
Critical
Chris Coulson

Bug Description

Setup
1. Install these silos:
https://requests.ci-train.ubuntu.com/#/ticket/1290 (silo69 - moving a lot still)
https://requests.ci-train.ubuntu.com/#/ticket/1286 (silo38)
and reboot the device. Ensure all packages installed ok.

2. Best to reproduce this issue is a Nexus 4 with Slimport cable & external monitor. Connect the N4 to the monitor.

3. Open the web browser on the external monitor

Bug: the initial size of the WebView is much too small. It is not filing its QQuickItem.
If you resize the webbrowser window, that fixes it.

I'll grab a photo shortly

Gerry Boland (gerboland) wrote :
Gerry Boland (gerboland) wrote :

This *might* be qtubuntu's fault. I fear when webbrowser starts while monitor attached, it believes its window is on the phone screen initially, so uses that scale. While setting up its window, then it is informed the window is moved to the external display, and the scale is then corrected.

I need to learn if oxide is able to deal with is window being moved between screens while it is starting up. Its geometry may not be re-calculated...

I'll also try to have Oxide placed on the correct surface at absolute startup. That'll be a qtmir/qtubuntu job, I'm look at it now.

Here is my debugging output (I manually added printfs to qtubuntu wherever scale is requested). I am also not seeing the "screenPropertyChanged" from qtubuntu, probably also a bad thing.

Loading module: 'libubuntu_application_api_touch_mirclient.so.3.0.0'
Added Screen with id 1 and geometry QRect(0,0 768x1280)
Added Screen with id 2 and geometry QRect(768,0 1920x1080)
=======================================
UbuntuScreen(0xb814ec20) - id: 1 geometry: QRect(0,0 768x1280) form factor: phone scale: 2.25
UbuntuScreen(0xb8153380) - id: 2 geometry: QRect(768,0 1920x1080) form factor: monitor scale: 1
=======================================
could not open containers config file "/home/phablet/.local/share/libertine/ContainersConfig.json"
XX: windowProperyuChanged - scale
XX: windowProperty - scale 2.25
Input device added: "keypad_8064" "/dev/input/event1" QFlags(0x1)
Input device added: "pmic8xxx_pwrkey" "/dev/input/event0" QFlags(0x1)
Input device added: "apq8064-tabla-snd-card Button Jack" "/dev/input/event3" QFlags()
Input device added: "apq8064-tabla-snd-card Headset Jack" "/dev/input/event4" QFlags(0x20)
Input device added: "touch_dev" "/dev/input/event2" QFlags(0x8)
Input device added: "hs_detect" "/dev/input/event5" QFlags(0x1|0x20)
Input device added: "unity8-simulated-mouse" "/dev/input/event6" QFlags(0x2)
XX: windowProperyuChanged - scale
XX: windowProperty - scale 1
ubuntumirclient: Got invalid serialized mime data. Ignoring it.
XX: nativeResourceForScreen - scale 2.25
XX: nativeResourceForScreen - scale 2.25
XX: nativeResourceForScreen - scale 2.25
XX: nativeResourceForScreen - scale 2.25
qml: Loaded 8 UA override(s) from file:///usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Web/ua-overrides-mobile.js
XX: nativeResourceForScreen - scale 1
XX: nativeResourceForScreen - scale 1
XX: nativeResourceForScreen - scale 1
XX: nativeResourceForScreen - scale 1
XX: nativeResourceForScreen - scale 1
XX: nativeResourceForScreen - scale 1

Gerry Boland (gerboland) wrote :

> I am also not seeing the "screenPropertyChanged" from qtubuntu, probably
> also a bad thing.
Nope, this is fine. No Screen properties actually change here

Gerry Boland (gerboland) wrote :

This is the current behaviour of qtubuntu:

1. webbrowser launches & creates a window
2. Qt creates window on the "primary" screen - which is the first screen it ever saw. This is the phone screen.
3. Oxide reads the current screen, and the scale parameter for it: 2.25 here
4. Once the window is shown, Unity8 places the window on the external screen
5. Webbrowser & oxide get notified their window is *moved* to the external screen
6. Oxide reads the current screen, and the scale parameter for it: 1.0 now

My current suspicion is that the Oxide view isn't resizing when its screen is changed. Testing this is tough for me atm, I'm curious if a patch like

+++ qt/quick/oxide_qquick_contents_view.cc
void ContentsView::screenChanged(QScreen* screen) {
  screenChangedHelper(screen);

  if (!proxy()) {
    return;
  }

  proxy()->screenUpdated();
+ proxy()->wasResized();
}

might have an impact. I hope Chris can try this out soon.

Gerry Boland (gerboland) wrote :

A valid question would be: why can't Oxide/Webbrowser know what screen its window will be placed on immediately, or at least sooner? This is something I'm also thinking about

Changed in oxide:
importance: Undecided → Critical
milestone: none → branch-1.16
status: New → In Progress
assignee: nobody → Chris Coulson (chrisccoulson)
Chris Coulson (chrisccoulson) wrote :
Changed in oxide:
status: In Progress → Fix Released
Gerry Boland (gerboland) wrote :

I can confirm this fix works! Thanks for looking into it Chris

Changed in canonical-devices-system-image:
assignee: nobody → David Barth (dbarth)
importance: Undecided → Critical
milestone: none → 11
status: New → In Progress
tags: added: lt-blocker
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers