summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-11-23 12:32:56 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-11-23 12:52:18 +0100
commit7c4b0aa9706bdb79f0f79841cf6704e2f613fe69 (patch)
tree77acbaa2d335759e0a5ed04d37608dce2b12acbc /src/plugins
parent110e49c9cecca34dfacad33d19e04612cc2671b2 (diff)
parenteade2255ea7cd8200569080e9b295479b1f51bed (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: src/corelib/io/qstandardpaths_win.cpp src/plugins/platforms/ios/qioswindow.mm src/plugins/platforms/ios/quiview.mm tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: I5deb0a0176a454a9c566e924d074ba60ce04f0bc
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/ios/qiosapplicationstate.mm6
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm11
-rw-r--r--src/plugins/platforms/ios/qiosglobal.h2
-rw-r--r--src/plugins/platforms/ios/qiosglobal.mm2
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm27
-rw-r--r--src/plugins/platforms/ios/quiview.mm2
6 files changed, 37 insertions, 13 deletions
diff --git a/src/plugins/platforms/ios/qiosapplicationstate.mm b/src/plugins/platforms/ios/qiosapplicationstate.mm
index 7b923e4692..13e7e1150f 100644
--- a/src/plugins/platforms/ios/qiosapplicationstate.mm
+++ b/src/plugins/platforms/ios/qiosapplicationstate.mm
@@ -39,6 +39,8 @@
#include "qiosapplicationstate.h"
+#include "qiosglobal.h"
+
#include <qpa/qwindowsysteminterface.h>
#include <QtCore/qcoreapplication.h>
@@ -72,8 +74,8 @@ static Qt::ApplicationState qtApplicationState(UIApplicationState uiApplicationS
static void handleApplicationStateChanged(UIApplicationState uiApplicationState)
{
Qt::ApplicationState state = qtApplicationState(uiApplicationState);
- QWindowSystemInterface::handleApplicationStateChanged(state);
- QWindowSystemInterface::flushWindowSystemEvents();
+ qCDebug(lcQpaApplication) << "moved to" << state;
+ QWindowSystemInterface::handleApplicationStateChanged<QWindowSystemInterface::SynchronousDelivery>(state);
}
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm
index 2d5286e971..6a6cbb4324 100644
--- a/src/plugins/platforms/ios/qioscontext.mm
+++ b/src/plugins/platforms/ios/qioscontext.mm
@@ -165,8 +165,6 @@ bool QIOSContext::makeCurrent(QPlatformSurface *surface)
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
framebufferObject.depthRenderbuffer);
}
-
- connect(static_cast<QIOSWindow *>(surface), SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*)));
} else {
glBindFramebuffer(GL_FRAMEBUFFER, framebufferObject.handle);
}
@@ -249,8 +247,13 @@ QIOSContext::FramebufferObject &QIOSContext::backingFramebufferObjectFor(QPlatfo
// should probably use QOpenGLMultiGroupSharedResource to track the shared default-FBOs.
if (m_sharedContext)
return m_sharedContext->backingFramebufferObjectFor(surface);
- else
- return m_framebufferObjects[surface];
+
+ if (!m_framebufferObjects.contains(surface)) {
+ // We're about to create a new FBO, make sure it's cleaned up as well
+ connect(static_cast<QIOSWindow *>(surface), SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*)));
+ }
+
+ return m_framebufferObjects[surface];
}
GLuint QIOSContext::defaultFramebufferObject(QPlatformSurface *surface) const
diff --git a/src/plugins/platforms/ios/qiosglobal.h b/src/plugins/platforms/ios/qiosglobal.h
index f74e3004cc..8b39aded06 100644
--- a/src/plugins/platforms/ios/qiosglobal.h
+++ b/src/plugins/platforms/ios/qiosglobal.h
@@ -47,7 +47,9 @@
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(lcQpaApplication);
Q_DECLARE_LOGGING_CATEGORY(lcQpaInputMethods);
+Q_DECLARE_LOGGING_CATEGORY(lcQpaWindow);
#if !defined(QT_NO_DEBUG)
#define qImDebug \
diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm
index 1482ffc7af..f27b2242df 100644
--- a/src/plugins/platforms/ios/qiosglobal.mm
+++ b/src/plugins/platforms/ios/qiosglobal.mm
@@ -44,7 +44,9 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcQpaApplication, "qt.qpa.application");
Q_LOGGING_CATEGORY(lcQpaInputMethods, "qt.qpa.input.methods");
+Q_LOGGING_CATEGORY(lcQpaWindow, "qt.qpa.window");
bool isQtApplication()
{
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm
index 4e6d48423d..bcec9899f7 100644
--- a/src/plugins/platforms/ios/qioswindow.mm
+++ b/src/plugins/platforms/ios/qioswindow.mm
@@ -239,15 +239,28 @@ void QIOSWindow::setWindowState(Qt::WindowStates state)
if (window()->isTopLevel() && window()->isVisible() && window()->isActive())
[m_view.qtViewController updateProperties];
- if (state & Qt::WindowMinimized)
+ if (state & Qt::WindowMinimized) {
applyGeometry(QRect());
- else if (state & Qt::WindowFullScreen)
- applyGeometry(screen()->geometry());
- else if (state & Qt::WindowMaximized)
- applyGeometry(window()->flags() & Qt::MaximizeUsingFullscreenGeometryHint ?
- screen()->geometry() : screen()->availableGeometry());
- else
+ } else if (state & (Qt::WindowFullScreen | Qt::WindowMaximized)) {
+ // When an application is in split-view mode, the UIScreen still has the
+ // same geometry, but the UIWindow is resized to the area reserved for the
+ // application. We use this to constrain the geometry used when applying the
+ // fullscreen or maximized window states. Note that we do not do this
+ // in applyGeometry(), as we don't want to artificially limit window
+ // placement "outside" of the screen bounds if that's what the user wants.
+
+ QRect uiWindowBounds = QRectF::fromCGRect(m_view.window.bounds).toRect();
+ QRect fullscreenGeometry = screen()->geometry().intersected(uiWindowBounds);
+ QRect maximizedGeometry = window()->flags() & Qt::MaximizeUsingFullscreenGeometryHint ?
+ fullscreenGeometry : screen()->availableGeometry().intersected(uiWindowBounds);
+
+ if (state & Qt::WindowFullScreen)
+ applyGeometry(fullscreenGeometry);
+ else
+ applyGeometry(maximizedGeometry);
+ } else {
applyGeometry(m_normalGeometry);
+ }
}
void QIOSWindow::setParent(const QPlatformWindow *parentWindow)
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm
index 1507ff37f7..849e61c409 100644
--- a/src/plugins/platforms/ios/quiview.mm
+++ b/src/plugins/platforms/ios/quiview.mm
@@ -161,6 +161,7 @@
QWindow *window = m_qioswindow->window();
QRect lastReportedGeometry = qt_window_private(window)->geometry;
QRect currentGeometry = QRectF::fromCGRect(self.frame).toRect();
+ qCDebug(lcQpaWindow) << m_qioswindow->window() << "new geometry is" << currentGeometry;
QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(window, currentGeometry);
if (currentGeometry.size() != lastReportedGeometry.size()) {
@@ -193,6 +194,7 @@
region = QRect(QPoint(), bounds);
}
+ qCDebug(lcQpaWindow) << m_qioswindow->window() << region << "isExposed" << m_qioswindow->isExposed();
QWindowSystemInterface::handleExposeEvent<QWindowSystemInterface::SynchronousDelivery>(m_qioswindow->window(), region);
}