summaryrefslogtreecommitdiffstats
path: root/src/plugins/graphicssystems/testlite
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-02-08 11:53:15 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-02-08 11:53:15 (GMT)
commit99ce03ef6c33a670d86706a8a7d701ac25e2e2b5 (patch)
tree66f474dde125e89f23e32fb747ec0c368463a2a6 /src/plugins/graphicssystems/testlite
parent6a34243acbd6960502efefd1af4a560c245301da (diff)
downloadQt-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.cpp1
-rw-r--r--src/plugins/graphicssystems/testlite/x11util.cpp9
-rw-r--r--src/plugins/graphicssystems/testlite/x11util.h1
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 &region, 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);