summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <jeremy.katz@nokia.com>2009-10-15 15:29:02 (GMT)
committerJeremy Katz <jeremy.katz@nokia.com>2009-10-16 09:03:52 (GMT)
commit3fc6f2c08d9648afc489175363a335e56b3f6526 (patch)
tree5c8d4eaffb27eb0da8121a8c02896e53b5370b92
parenteb9c3bee3cef8660cb2a05012f41f183a64c40de (diff)
downloadQt-3fc6f2c08d9648afc489175363a335e56b3f6526.zip
Qt-3fc6f2c08d9648afc489175363a335e56b3f6526.tar.gz
Qt-3fc6f2c08d9648afc489175363a335e56b3f6526.tar.bz2
Allow VNC top level widgits to be hidden
via QGraphicsSystemScreen::setVisible()
-rw-r--r--src/plugins/graphicssystems/vnc/qgraphicssystem_vnc.cpp4
-rw-r--r--src/plugins/graphicssystems/vnc/qwindowsurface_vnc.cpp8
-rw-r--r--src/plugins/graphicssystems/vnc/qwindowsurface_vnc.h4
3 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/graphicssystems/vnc/qgraphicssystem_vnc.cpp b/src/plugins/graphicssystems/vnc/qgraphicssystem_vnc.cpp
index b50e5b5..52f354a 100644
--- a/src/plugins/graphicssystems/vnc/qgraphicssystem_vnc.cpp
+++ b/src/plugins/graphicssystems/vnc/qgraphicssystem_vnc.cpp
@@ -87,10 +87,14 @@ void QVNCGraphicsSystemScreen::setDirty(const QRect &rect)
compositePainter.fillRect(rect, Qt::black);
for (int i = 0; i < windowStack.length(); i++) {
+ if (!windowStack[i]->visible())
+ continue;
QRect windowRect = windowStack[i]->geometry();
QRect intersect = windowRect.intersected(rect);
QRect windowIntersect = intersect.translated(-windowRect.left(),
-windowRect.top());
+ if (intersect.isNull())
+ continue;
compositePainter.drawImage(intersect, windowStack[i]->image(),
windowIntersect);
}
diff --git a/src/plugins/graphicssystems/vnc/qwindowsurface_vnc.cpp b/src/plugins/graphicssystems/vnc/qwindowsurface_vnc.cpp
index af171f5..a3bce49 100644
--- a/src/plugins/graphicssystems/vnc/qwindowsurface_vnc.cpp
+++ b/src/plugins/graphicssystems/vnc/qwindowsurface_vnc.cpp
@@ -51,7 +51,8 @@ QT_BEGIN_NAMESPACE
QVNCWindowSurface::QVNCWindowSurface(QVNCGraphicsSystem *graphicsSystem,
QVNCGraphicsSystemScreen *screen, QWidget *window)
: QWindowSurface(window),
- mScreen(screen)
+ mScreen(screen),
+ visibleFlag(false)
{
mImage = QImage(window->size(), mScreen->format());
}
@@ -115,4 +116,9 @@ void QVNCWindowSurface::endPaint(const QRegion &region)
Q_UNUSED(region);
}
+void QVNCWindowSurface::setVisible(bool visible)
+{
+ visibleFlag = visible;
+ mScreen->setDirty(geometry());
+}
QT_END_NAMESPACE
diff --git a/src/plugins/graphicssystems/vnc/qwindowsurface_vnc.h b/src/plugins/graphicssystems/vnc/qwindowsurface_vnc.h
index b9af493..477fe1b 100644
--- a/src/plugins/graphicssystems/vnc/qwindowsurface_vnc.h
+++ b/src/plugins/graphicssystems/vnc/qwindowsurface_vnc.h
@@ -65,12 +65,14 @@ public:
void beginPaint(const QRegion &region);
void endPaint(const QRegion &region);
inline const QImage image() { return mImage; }
-
+ void setVisible(bool visible);
+ bool visible() { return visibleFlag; }
private:
QVNCGraphicsSystem *mGraphicsSystem;
QVNCGraphicsSystemScreen *mScreen;
QRect oldGeometry;
QImage mImage;
+ bool visibleFlag;
};
QT_END_NAMESPACE