diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-02-08 11:53:15 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-02-08 11:53:15 (GMT) |
commit | 99ce03ef6c33a670d86706a8a7d701ac25e2e2b5 (patch) | |
tree | 66f474dde125e89f23e32fb747ec0c368463a2a6 /src/plugins/graphicssystems/testlite | |
parent | 6a34243acbd6960502efefd1af4a560c245301da (diff) | |
download | Qt-99ce03ef6c33a670d86706a8a7d701ac25e2e2b5.zip Qt-99ce03ef6c33a670d86706a8a7d701ac25e2e2b5.tar.gz Qt-99ce03ef6c33a670d86706a8a7d701ac25e2e2b5.tar.bz2 |
Get rid of black flickering on resize
Diffstat (limited to 'src/plugins/graphicssystems/testlite')
-rw-r--r-- | src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp | 1 | ||||
-rw-r--r-- | src/plugins/graphicssystems/testlite/x11util.cpp | 9 | ||||
-rw-r--r-- | src/plugins/graphicssystems/testlite/x11util.h | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp index 0d277b8..d50a59e 100644 --- a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp +++ b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp @@ -86,6 +86,7 @@ void QTestLiteWindowSurface::flush(QWidget *widget, const QRegion ®ion, const // qDebug() << "QTestLiteWindowSurface::flush:" << (long)this; + xw->painted = true; //there is content in the buffer xw->paintEvent(); } diff --git a/src/plugins/graphicssystems/testlite/x11util.cpp b/src/plugins/graphicssystems/testlite/x11util.cpp index 7ad3ed5..20d4241 100644 --- a/src/plugins/graphicssystems/testlite/x11util.cpp +++ b/src/plugins/graphicssystems/testlite/x11util.cpp @@ -468,7 +468,7 @@ MyWindow::MyWindow(MyDisplay *display, int x, int y, int w, int h) currentCursor = -1; image_info = 0; - + painted = false; } @@ -517,8 +517,11 @@ void MyWindow::closeEvent() void MyWindow::paintEvent() { #ifdef MYX11_DEBUG - qDebug() << "MyWindow::paintEvent" << shm_img.size(); + qDebug() << "MyWindow::paintEvent" << shm_img.size() << painted; #endif + if (!painted) + return; + #ifdef DONT_USE_MIT_SHM // just convert the image every time... if (!shm_img.isNull()) { @@ -596,6 +599,8 @@ void MyWindow::resizeShmImage(int width, int height) Q_ASSERT(shm_attach_status == True); shm_img = QImage( (uchar*) image->data, image->width, image->height, image->bytes_per_line, QImage::Format_RGB32 ); + + painted = false; #endif } diff --git a/src/plugins/graphicssystems/testlite/x11util.h b/src/plugins/graphicssystems/testlite/x11util.h index 76e029d..184c1ca 100644 --- a/src/plugins/graphicssystems/testlite/x11util.h +++ b/src/plugins/graphicssystems/testlite/x11util.h @@ -136,6 +136,7 @@ public: //### QTestLiteWindowSurface *windowSurface; int currentCursor; + bool painted; private: void resizeShmImage(int width, int height); |