summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/androidwindowembedding.cpp
diff options
context:
space:
mode:
authorTinja Paavoseppä <[email protected]>2024-02-23 14:41:30 +0200
committerTinja Paavoseppä <[email protected]>2024-03-13 15:50:14 +0000
commit7942f7eedf4a8d7fac82737ea490f3c443e82149 (patch)
tree1606580e783377ff5026be12687f096f9649ae2d /src/plugins/platforms/android/androidwindowembedding.cpp
parentd899cdb3a4dc9eb1ad489f7541244110e7e80f61 (diff)
Android: Resize QWindow when its QtView is resized
If the Android View is resized, the QWindow instantiated by it should be resized accordingly. Task-number: QTBUG-122626 Pick-to: 6.7 Change-Id: I7bfbca149f927718d1e28cdabfa8759afbd06039 Reviewed-by: Assam Boudjelthia <[email protected]>
Diffstat (limited to 'src/plugins/platforms/android/androidwindowembedding.cpp')
-rw-r--r--src/plugins/platforms/android/androidwindowembedding.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/androidwindowembedding.cpp b/src/plugins/platforms/android/androidwindowembedding.cpp
index 7d82ac6d87e..e72bb326ccc 100644
--- a/src/plugins/platforms/android/androidwindowembedding.cpp
+++ b/src/plugins/platforms/android/androidwindowembedding.cpp
@@ -45,6 +45,13 @@ namespace QtAndroidWindowEmbedding {
});
}
+ void resizeWindow(JNIEnv *, jclass, jlong windowRef, jint width, jint height)
+ {
+ QWindow *window = reinterpret_cast<QWindow*>(windowRef);
+ window->setWidth(width);
+ window->setHeight(height);
+ }
+
bool registerNatives(QJniEnvironment& env) {
using namespace QtJniTypes;
bool success = env.registerNativeMethods(Traits<QtEmbeddedDelegate>::className(),
@@ -52,7 +59,8 @@ namespace QtAndroidWindowEmbedding {
Q_JNI_NATIVE_SCOPED_METHOD(deleteWindow, QtAndroidWindowEmbedding)});
success &= env.registerNativeMethods(Traits<QtView>::className(),
- {Q_JNI_NATIVE_SCOPED_METHOD(setWindowVisible, QtAndroidWindowEmbedding)});
+ {Q_JNI_NATIVE_SCOPED_METHOD(setWindowVisible, QtAndroidWindowEmbedding),
+ Q_JNI_NATIVE_SCOPED_METHOD(resizeWindow, QtAndroidWindowEmbedding)});
return success;
}