summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r--src/gui/kernel/qguiapplication.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 6a8f8582be..b3adcfcbaf 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1078,11 +1078,16 @@ void QGuiApplicationPrivate::reportScreenOrientationChange(QWindowSystemInterfac
return;
QScreen *s = e->screen.data();
- s->d_func()->currentOrientation = e->orientation;
+ s->d_func()->orientation = e->orientation;
- emit s->currentOrientationChanged(s->currentOrientation());
+ reportScreenOrientationChange(s);
+}
+
+void QGuiApplicationPrivate::reportScreenOrientationChange(QScreen *s)
+{
+ emit s->orientationChanged(s->orientation());
- QScreenOrientationChangeEvent event(s, s->currentOrientation());
+ QScreenOrientationChangeEvent event(s, s->orientation());
QCoreApplication::sendEvent(QCoreApplication::instance(), &event);
}
@@ -1098,6 +1103,10 @@ void QGuiApplicationPrivate::reportGeometryChange(QWindowSystemInterfacePrivate:
QScreen *s = e->screen.data();
s->d_func()->geometry = e->geometry;
+ Qt::ScreenOrientation primaryOrientation = s->primaryOrientation();
+ Qt::ScreenOrientation orientation = s->orientation();
+ s->d_func()->updatePrimaryOrientation();
+
emit s->sizeChanged(s->size());
emit s->geometryChanged(s->geometry());
emit s->physicalDotsPerInchXChanged(s->physicalDotsPerInchX());
@@ -1105,6 +1114,12 @@ void QGuiApplicationPrivate::reportGeometryChange(QWindowSystemInterfacePrivate:
emit s->physicalDotsPerInchChanged(s->physicalDotsPerInch());
emit s->availableSizeChanged(s->availableSize());
emit s->availableGeometryChanged(s->availableGeometry());
+
+ if (s->primaryOrientation() != primaryOrientation)
+ emit s->primaryOrientationChanged(s->primaryOrientation());
+
+ if (s->orientation() != orientation)
+ reportScreenOrientationChange(s);
}
void QGuiApplicationPrivate::reportAvailableGeometryChange(