Only set frame margins as dirty when we get a configure notify event.
authorSamuel Rødal <samuel.rodal@nokia.com>
Thu, 22 Sep 2011 07:00:55 +0000 (09:00 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 23 Sep 2011 09:30:47 +0000 (11:30 +0200)
It's dangerous to set them as dirty in anticipation of a configure
notify event, as if frameMargins() is called before the event is
received the computed values are bogus.

Change-Id: Ib6db975fba5fcb13a2511e4716cbb5ca79265c34
Reviewed-on: http://codereview.qt-project.org/5365
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/plugins/platforms/xcb/qxcbwindow.cpp

index 5458674..56c5c48 100644 (file)
@@ -139,7 +139,6 @@ void QXcbWindow::create()
     destroy();
 
     m_windowState = Qt::WindowNoState;
-    m_dirtyFrameMargins = true;
 
     Qt::WindowType type = window()->windowType();
 
@@ -457,8 +456,6 @@ void QXcbWindow::show()
             free(error);
         }
 
-        m_dirtyFrameMargins = true;
-
         if (window()->windowState() & Qt::WindowMinimized)
             xcb_wm_hints_set_iconic(&hints);
         else
@@ -774,8 +771,6 @@ Qt::WindowState QXcbWindow::setWindowState(Qt::WindowState state)
     if (state == m_windowState)
         return state;
 
-    m_dirtyFrameMargins = true;
-
     // unset old state
     switch (m_windowState) {
     case Qt::WindowMinimized:
@@ -1175,6 +1170,8 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
     QPlatformWindow::setGeometry(rect);
     QWindowSystemInterface::handleGeometryChange(window(), rect);
 
+    m_dirtyFrameMargins = true;
+
 #if XCB_USE_DRI2
     if (m_context)
         static_cast<QDri2Context *>(m_context)->resize(rect.size());