summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-05 00:47:42 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-05 00:47:42 (GMT)
commit3d5aacccdb14ca428cc05e2a0db36bf3baa1a1fa (patch)
treecf5f0dcc069c6342e3839e3cee606445bac28fce /src/gui/kernel
parentd499f265aa42231fd08df18213083aebe0db59ec (diff)
parente2f439d8ff3529d9ef50ac58da61432627a8f350 (diff)
downloadQt-3d5aacccdb14ca428cc05e2a0db36bf3baa1a1fa.zip
Qt-3d5aacccdb14ca428cc05e2a0db36bf3baa1a1fa.tar.gz
Qt-3d5aacccdb14ca428cc05e2a0db36bf3baa1a1fa.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (42 commits) Cleanup after "Changed qgraphicswidget autotest to use qWaitForWindowShown" Cleanup after "QGraphicsWidget is painted twice on the first show" Changed qgraphicswidget autotest to use qWaitForWindowShown. Improved QTest::qWaitForWindowShown on X11. Stabilize tst_QGraphicsWidget::initialShow2 (new test) Make sure we define S_IFDIR on Windows Fix copy/pasto Crash when closing any top-level widget on Symbian. Cache the sizes of the images in an animated GIF. Fix the QAbstractSlider autotest. Use OpenVG scissor on 90/180/270 rotations and simple clips. Optimize single-rect IntersectClip in OpenVG using the scissor QGraphicsWidget is painted twice on the first show. Compiler warning in QAbstractSlider. Optimize QPathClipper::pathToRect. QGraphicsScene: Use QPainter::setClipRect instead of setClipPath if possible. QStyleSheetStyle: Fix combinaison of border-image and border-radius Revert "QAbstractScrollArea: Wheel over a scrollarea that has only one horizontal scrollbar" Proper Fav icon is not shown, for all the links default fav icon shown Update changes-4.6.2. ...
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qwidget.cpp13
-rw-r--r--src/gui/kernel/qwidget_x11.cpp75
2 files changed, 57 insertions, 31 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index ffad38b..4520a1b 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -1439,7 +1439,16 @@ QWidget::~QWidget()
}
#endif
- if (QWidgetBackingStore *bs = d->maybeBackingStore()) {
+ if (d->extra && d->extra->topextra && d->extra->topextra->backingStore) {
+ // Okay, we are about to destroy the top-level window that owns
+ // the backing store. Make sure we delete the backing store right away
+ // before the window handle is invalid. This is important because
+ // the backing store will delete its window surface, which may or may
+ // not have a reference to this widget that will be used later to
+ // notify the window it no longer has a surface.
+ delete d->extra->topextra->backingStore;
+ d->extra->topextra->backingStore = 0;
+ } else if (QWidgetBackingStore *bs = d->maybeBackingStore()) {
bs->removeDirtyWidget(this);
if (testAttribute(Qt::WA_StaticContents))
bs->removeStaticWidget(this);
@@ -6414,6 +6423,8 @@ void QWidget::setTabOrder(QWidget* first, QWidget *second)
first = fp;
}
+ if (fp == second)
+ return;
if (QWidget *sp = second->focusProxy())
second = sp;
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 4684bc1..007de7f 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -346,11 +346,6 @@ Q_GUI_EXPORT void qt_x11_enforce_cursor(QWidget * w)
qt_x11_enforce_cursor(w, false);
}
-static Bool checkForConfigureAndExpose(Display *, XEvent *e, XPointer)
-{
- return e->type == ConfigureNotify || e->type == Expose;
-}
-
Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w)
{
if (!w || (!w->isWindow() && !w->internalWinId()))
@@ -363,38 +358,58 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w)
if (!w->testAttribute(Qt::WA_WState_Created))
return;
- if (!(w->windowFlags() & Qt::X11BypassWindowManagerHint)) {
- // if the window is not override-redirect, then the window manager
- // will reparent us to the frame decoration window.
- while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), ReparentNotify, &ev)) {
- if (t.elapsed() > maximumWaitTime)
- return;
- qApp->syncX(); // non-busy wait
- }
- }
+ // first deliver events that are already in the local queue
+ QApplication::sendPostedEvents();
- while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), MapNotify, &ev)) {
- if (t.elapsed() > maximumWaitTime)
- return;
- qApp->syncX(); // non-busy wait
- }
+ // the normal sequence is:
+ // ... ConfigureNotify ... ReparentNotify ... MapNotify ... Expose
+ // with X11BypassWindowManagerHint:
+ // ConfigureNotify ... MapNotify ... Expose
- qApp->x11ProcessEvent(&ev);
+ enum State {
+ Initial, Reparented, Mapped
+ } state = Initial;
- // ok, seems like the window manager successfully reparented us, we'll wait
- // for the first paint event to arrive, while handling ConfigureNotify in
- // the arrival order
- while(1)
- {
- if (XCheckIfEvent(X11->display, &ev, checkForConfigureAndExpose, 0)) {
+ do {
+ if (XEventsQueued(X11->display, QueuedAlready)) {
+ XNextEvent(X11->display, &ev);
qApp->x11ProcessEvent(&ev);
- if (ev.type == Expose)
- return;
+
+ if (w->windowFlags() & Qt::X11BypassWindowManagerHint) {
+ switch (state) {
+ case Initial:
+ case Reparented:
+ if (ev.type == MapNotify)
+ state = Mapped;
+ break;
+ case Mapped:
+ if (ev.type == Expose)
+ return;
+ break;
+ }
+ } else {
+ switch (state) {
+ case Initial:
+ if (ev.type == ReparentNotify)
+ state = Reparented;
+ break;
+ case Reparented:
+ if (ev.type == MapNotify)
+ state = Mapped;
+ break;
+ case Mapped:
+ if (ev.type == Expose)
+ return;
+ break;
+ }
+ }
+ } else {
+ if (!XEventsQueued(X11->display, QueuedAfterFlush))
+ qApp->syncX(); // non-busy wait
}
if (t.elapsed() > maximumWaitTime)
return;
- qApp->syncX(); // non-busy wait
- }
+ } while(1);
}
void qt_change_net_wm_state(const QWidget* w, bool set, Atom one, Atom two = 0)