Currently when the screen is rotated we end up sneding size updates to
the engine 3 times. Only the last size update is actuall correct.
For example on Jolla phone with screen size of 540x960 when the screen
is rotated from potrtrait mode to landscape.
QOpenGLWebPage::updateContentOrientation is called which in turn
calls QOpenGLWebPage::setSurfaceSize(960x540, Landscape). Since the
setSurfaceSize does not modify d->mSize, but it does call
d->UpdateViewSize() will end up notifying gecko about view size
change to 540x960 (old size still storred in d->mSize).
QML layer calls QOpenGLWebPage::setHeight(540), which in turn calls
::setSize(540x540). This invalid size is sent to the engine.
QML layer calls QOpenGLWebPage::setWidth(960), which calls
::setSize(960x540). This is the correct final size that is also
sent to the engine.
This patch fixes the problem by:
Making sure QOpenGLWebPage::updateContentOrientation also modifies
view size by calling ::setSize
Calling d->UpdateViewSize() from a queued slot connection. This way we
can schedule view size update multiple times but in the end it'll be only
called once.
With this patch in place rotating the screen updates embedlite view size only
once.
Currently when the screen is rotated we end up sneding size updates to the engine 3 times. Only the last size update is actuall correct.
For example on Jolla phone with screen size of 540x960 when the screen is rotated from potrtrait mode to landscape.
This patch fixes the problem by:
With this patch in place rotating the screen updates embedlite view size only once.