summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow.cpp23
-rw-r--r--src/plugins/platforms/ios/quiview.mm15
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp4
3 files changed, 15 insertions, 27 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
index 69582a91d3..6aaf0d6d6d 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
@@ -41,6 +41,7 @@
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformintegration.h>
#include <private/qguiapplication_p.h>
+#include <private/qwindow_p.h>
#ifndef QT_NO_OPENGL
# include <QtGui/private/qopenglcontext_p.h>
# include <QtGui/QOpenGLContext>
@@ -234,21 +235,19 @@ void QEglFSWindow::setVisible(bool visible)
void QEglFSWindow::setGeometry(const QRect &r)
{
- QRect rect;
- bool forceFullscreen = m_flags.testFlag(HasNativeWindow);
- if (forceFullscreen)
- rect = screen()->availableGeometry();
- else
- rect = r;
+ // Persist the requested rect, like a normal setGeometry call
+ QPlatformWindow::setGeometry(r);
- const bool changed = rect != QPlatformWindow::geometry();
- QPlatformWindow::setGeometry(rect);
+ // Take care of WM behavior, constrain/modify geometry
+ QRect rect = r;
+ if (m_flags.testFlag(HasNativeWindow))
+ rect = screen()->availableGeometry();
- // if we corrected the size, trigger a resize event
- if (rect != r)
- QWindowSystemInterface::handleGeometryChange(window(), rect, r);
+ // React to the setGeometry, as if from a WM callback
+ QRect lastReportedGeometry = qt_window_private(window())->geometry;
+ QWindowSystemInterface::handleGeometryChange(window(), rect);
- if (changed)
+ if (rect != lastReportedGeometry)
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), rect.size()));
}
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm
index a1110839ad..dcdb5ae53f 100644
--- a/src/plugins/platforms/ios/quiview.mm
+++ b/src/plugins/platforms/ios/quiview.mm
@@ -151,19 +151,12 @@
qWarning() << m_qioswindow->window()
<< "is backed by a UIView that has a transform set. This is not supported.";
- // The original geometry requested by setGeometry() might be different
- // from what we end up with after applying window constraints.
- QRect requestedGeometry = m_qioswindow->geometry();
-
- QRect actualGeometry = QRectF::fromCGRect(self.frame).toRect();
-
- QRect previousGeometry = requestedGeometry != actualGeometry ?
- requestedGeometry : qt_window_private(m_qioswindow->window())->geometry;
-
QWindow *window = m_qioswindow->window();
- QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(window, actualGeometry, previousGeometry);
+ QRect lastReportedGeometry = qt_window_private(window)->geometry;
+ QRect currentGeometry = QRectF::fromCGRect(self.frame).toRect();
+ QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(window, currentGeometry);
- if (actualGeometry.size() != previousGeometry.size()) {
+ if (currentGeometry.size() != lastReportedGeometry.size()) {
// Trigger expose event on resize
[self setNeedsDisplay];
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index dc258a83f9..74c8f45b36 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -2077,10 +2077,6 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
if (!newScreen)
return;
- // FIXME: In the case of the requestedGeometry not matching the actualGeometry due
- // to e.g. the window manager applying restrictions to the geometry, the application
- // will never see a move/resize event if the actualGeometry is the same as the current
- // geometry, and may think the requested geometry was fulfilled.
QWindowSystemInterface::handleGeometryChange(window(), actualGeometry);
// QPlatformScreen::screen() is updated asynchronously, so we can't compare it