sailfishos / sailfish-components-webview

Mozilla Public License 2.0
13 stars 23 forks source link

[webview] Correctly update viewportHeight on orientation change. Fixes JB#59065 #162

Closed llewelld closed 1 year ago

llewelld commented 1 year ago

When the device orientation changes the WebView height must be updated to match. Previously this was based on the screen height and width, but didn't take into account the possibility of non-full-screen use. Commit df9ae3ced8e2a7c tried to fix this by switching screen height for widget height.

However the fix didn't consider the fact that the height and width are already reversed on orientation change. The result was that in portrait mode the wrong height was set.

This change attempts to address this by always using the widget height.

llewelld commented 1 year ago

@poetaster: I tested this change with your webview-screensize test tool, with positive results. But would you be able to give it some more robust testing with your other apps please?

I can supply you with a package to install, but it might be easier just to edit the /usr/lib64/qt5/qml/Sailfish/WebView/WebView.qml file on your device directly for testing (but please be aware this may cause breakage, so please keep a backup).

poetaster commented 1 year ago

Ok, this makes scaling behaviour work properly. For instance, in mah-solitaire ... I just did the quick on device test.

Sadly it also demonstrates that something else is broken on the volla/gs290/gs5 side of things. But, I can play with this warpper and see if I get any the wiser ;) Thanks!

llewelld commented 1 year ago

Thanks for testing this @poetaster. I'm glad it fixes at least this issue. The Volla/gs290/gs5 issue is harder for me to contribute to as I don't have access to the devices, but if there's something you think I might be able to help with, please ask.