Android/QtView: Move resizing of the QWindow to Qt thread
Since any window resize events originating from Qt side are ran in the Qt thread, having the one originating from Android run in the Android thread can lead to race conditions especially during orientation changes. Change-Id: Iebebec2fffdaf9181b01fc1e8f539c7bc232996d Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 02bab22fde5de84c62e3eb86fde03248851d11dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f3b91c0dae
commit
29436d1290
@ -49,11 +49,13 @@ namespace QtAndroidWindowEmbedding {
|
||||
|
||||
void resizeWindow(JNIEnv *, jclass, jlong windowRef, jint x, jint y, jint width, jint height)
|
||||
{
|
||||
QMetaObject::invokeMethod(qApp, [windowRef, x, y, width, height] {
|
||||
QWindow *window = reinterpret_cast<QWindow*>(windowRef);
|
||||
QWindow *parent = window->parent();
|
||||
if (parent)
|
||||
parent->setGeometry(x, y, width, height);
|
||||
window->setGeometry(0, 0, width, height);
|
||||
});
|
||||
}
|
||||
|
||||
bool registerNatives(QJniEnvironment& env) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user