diff options
author | A-Team <ateam@pad.test.qt.nokia.com> | 2010-09-07 12:31:14 (GMT) |
---|---|---|
committer | A-Team <ateam@pad.test.qt.nokia.com> | 2010-09-07 12:31:14 (GMT) |
commit | 30cf45cf53e030158fef4dfb262e7444332d3138 (patch) | |
tree | 3bfe9133feb8d1505b6e394e791a348cdf4d475f /src/gui/kernel | |
parent | d52f0887a740d147a74c3e38ae587f688fbf896a (diff) | |
parent | 3505c6cdcdfac5a6d0f4b94dbdbcc8ad72f8048a (diff) | |
download | Qt-30cf45cf53e030158fef4dfb262e7444332d3138.zip Qt-30cf45cf53e030158fef4dfb262e7444332d3138.tar.gz Qt-30cf45cf53e030158fef4dfb262e7444332d3138.tar.bz2 |
Merge branch '4.7-oslo1' into 4.7-doc
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 7 | ||||
-rw-r--r-- | src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 6 | ||||
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qgesturemanager_p.h | 4 |
4 files changed, 15 insertions, 5 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index e4d9848..7495f6d 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -3642,6 +3642,11 @@ int QApplication::x11ProcessEvent(XEvent* event) case MapNotify: // window shown if (widget->isWindow()) { + // if we got a MapNotify when we were not waiting for it, it most + // likely means the user has already asked to hide the window before + // it ever being shown, so we try to withdraw a window after sending + // the QShowEvent. + bool pendingHide = widget->testAttribute(Qt::WA_WState_ExplicitShowHide) && widget->testAttribute(Qt::WA_WState_Hidden); widget->d_func()->topData()->waitingForMapNotify = 0; if (widget->windowType() != Qt::Popup) { @@ -3661,6 +3666,8 @@ int QApplication::x11ProcessEvent(XEvent* event) widget->setAttribute(Qt::WA_WState_Visible, true); } } + if (pendingHide) // hide the window + XWithdrawWindow(X11->display, widget->internalWinId(), widget->x11Info().screen()); } break; diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index 16f5bd6..ddf1a27 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -234,8 +234,10 @@ QT_END_NAMESPACE // This method is called the first time the window is placed on screen and // is the earliest point in time we can connect OpenGL contexts to NSViews. QWidget *qwidget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self]; - qt_event_request_window_change(qwidget); - qt_mac_send_posted_gl_updates(qwidget); + if (qwidget) { + qt_event_request_window_change(qwidget); + qt_mac_send_posted_gl_updates(qwidget); + } [super setInitialFirstResponder:view]; } diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 570d7a5..f50dbbd 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -162,7 +162,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ QMap<ObjectGesture, QList<QGesture *> >::Iterator iter = m_objectGestures.begin(); while (iter != m_objectGestures.end()) { ObjectGesture objectGesture = iter.key(); - if (objectGesture.gesture == type && target == objectGesture.object.data()) { + if (objectGesture.gesture == type && target == objectGesture.object) { QSet<QGesture *> gestures = iter.value().toSet(); for (QHash<QGestureRecognizer *, QSet<QGesture *> >::iterator it = m_obsoleteGestures.begin(), e = m_obsoleteGestures.end(); it != e; ++it) { @@ -172,6 +172,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ m_deletedRecognizers.remove(g); m_gestureToRecognizer.remove(g); } + qDeleteAll(gestures); iter = m_objectGestures.erase(iter); } else { diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h index 747cb1a..0d84b67 100644 --- a/src/gui/kernel/qgesturemanager_p.h +++ b/src/gui/kernel/qgesturemanager_p.h @@ -106,13 +106,13 @@ private: struct ObjectGesture { - QWeakPointer<QObject> object; + QObject* object; Qt::GestureType gesture; ObjectGesture(QObject *o, const Qt::GestureType &g) : object(o), gesture(g) { } inline bool operator<(const ObjectGesture &rhs) const { - if (object.data() < rhs.object.data()) + if (object < rhs.object) return true; if (object == rhs.object) return gesture < rhs.gesture; |