summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/android/src/qandroidplatformintegration.cpp')
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformintegration.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
index cbd0f26835..3de6c47ad0 100644
--- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
@@ -43,6 +43,7 @@
#include "qabstracteventdispatcher.h"
#include "androidjnimain.h"
#include <QtGui/private/qpixmap_raster_p.h>
+#include <QtGui/qguiapplication.h>
#include <qpa/qwindowsysteminterface.h>
#include <QThread>
#include <qpa/qplatformwindow.h>
@@ -85,9 +86,6 @@ void *QAndroidPlatformNativeInterface::nativeResourceForIntegration(const QByteA
QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList &paramList)
: m_touchDevice(0)
-#ifdef ANDROID_PLUGIN_OPENGL
- , m_primaryWindow(0)
-#endif
{
Q_UNUSED(paramList);
@@ -116,6 +114,7 @@ bool QAndroidPlatformIntegration::hasCapability(Capability cap) const
{
switch (cap) {
case ThreadedPixmaps: return true;
+ case NonFullScreenWindows: return false;
default:
#ifndef ANDROID_PLUGIN_OPENGL
return QPlatformIntegration::hasCapability(cap);
@@ -143,28 +142,32 @@ QAbstractEventDispatcher *QAndroidPlatformIntegration::guiThreadEventDispatcher(
#else // !ANDROID_PLUGIN_OPENGL
QPlatformWindow *QAndroidPlatformIntegration::createPlatformWindow(QWindow *window) const
{
- if (m_primaryWindow != 0) {
- qWarning("QAndroidPlatformIntegration::createPlatformWindow: Unsupported case: More than "
- "one top-level window created.");
- }
-
- m_primaryWindow = new QAndroidOpenGLPlatformWindow(window);
- m_primaryWindow->requestActivateWindow();
+ QAndroidOpenGLPlatformWindow *platformWindow = new QAndroidOpenGLPlatformWindow(window);
+ platformWindow->create();
+ platformWindow->requestActivateWindow();
QtAndroidMenu::setActiveTopLevelWindow(window);
- return m_primaryWindow;
+ return platformWindow;
}
void QAndroidPlatformIntegration::invalidateNativeSurface()
{
- if (m_primaryWindow != 0)
- m_primaryWindow->invalidateSurface();
+ foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
+ QAndroidOpenGLPlatformWindow *window =
+ static_cast<QAndroidOpenGLPlatformWindow *>(w->handle());
+ if (window != 0)
+ window->invalidateSurface();
+ }
}
void QAndroidPlatformIntegration::surfaceChanged()
{
- if (m_primaryWindow != 0)
- m_primaryWindow->resetSurface();
+ foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
+ QAndroidOpenGLPlatformWindow *window =
+ static_cast<QAndroidOpenGLPlatformWindow *>(w->handle());
+ if (window != 0)
+ window->resetSurface();
+ }
}
QPlatformOpenGLContext *QAndroidPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const