summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorSergio Ahumada <sahumada@blackberry.com>2014-06-11 20:11:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-11 23:06:01 +0200
commit490e79e39ee90ad89bac164891177160d1926fdf (patch)
treef6e993c617f81ccd75563e1ceeef5ee5efd1b818 /src/widgets/kernel
parenta6d7e09e89a73b3706aabbf2d08586f238348c7c (diff)
parent7ffbfed7c791b1c8e514b5c9d24e8b80de3f21c2 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into 5.3" into refs/staging/5.3
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp5
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp12
2 files changed, 11 insertions, 6 deletions
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index 17ed4ca477..e5f552679c 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -779,10 +779,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
}
}
- // generate a move event for QWidgets without window handles. QWidgets with native
- // window handles already receive a move event from
- // QGuiApplicationPrivate::processGeometryChangeEvent.
- if (isMove && (!q->windowHandle() || q->testAttribute(Qt::WA_DontShowOnScreen))) {
+ if (isMove) {
QMoveEvent e(q->pos(), oldPos);
QApplication::sendEvent(q, &e);
}
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index fc328e7af0..35a526e77d 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -591,16 +591,24 @@ void QWidgetWindow::updateNormalGeometry()
void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
{
+ // If the widget's position already matches that of the event, this is a
+ // result of call to QWidget::move(), which already sends an event.
+ const bool spontaneous = m_widget->geometry().topLeft() != event->pos();
updateGeometry();
- QGuiApplication::sendSpontaneousEvent(m_widget, event);
+ if (spontaneous)
+ QGuiApplication::sendSpontaneousEvent(m_widget, event);
}
void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
{
QSize oldSize = m_widget->data->crect.size();
+ // If the widget's size already matches that of the event, this is a
+ // result of call to QWidget::resize(), which already sends an event.
+ const bool spontaneous = oldSize != event->size();
updateGeometry();
- QGuiApplication::sendSpontaneousEvent(m_widget, event);
+ if (spontaneous)
+ QGuiApplication::sendSpontaneousEvent(m_widget, event);
if (m_widget->d_func()->paintOnScreen()) {
QRegion updateRegion(geometry());