summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <jeremy.katz@nokia.com>2009-09-23 15:29:10 (GMT)
committerJeremy Katz <jeremy.katz@nokia.com>2009-09-23 15:32:45 (GMT)
commit74ba43ee9b82f46d07d4055af4e9ac7706701cea (patch)
tree4e7fbe2fdf3a2ecccf53f4883c90d1f0360d2446
parentf4c948dde1159b3a04a507781f1e0f89bd4b3b37 (diff)
downloadQt-74ba43ee9b82f46d07d4055af4e9ac7706701cea.zip
Qt-74ba43ee9b82f46d07d4055af4e9ac7706701cea.tar.gz
Qt-74ba43ee9b82f46d07d4055af4e9ac7706701cea.tar.bz2
Don't disable painting with multiple screens and VNC
Task-number: QTBUG-4473 Reviewed-by: Paul
-rw-r--r--src/gui/embedded/qscreenmulti_qws.cpp4
-rw-r--r--src/plugins/gfxdrivers/vnc/qscreenvnc_p.h2
-rw-r--r--src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp20
3 files changed, 18 insertions, 8 deletions
diff --git a/src/gui/embedded/qscreenmulti_qws.cpp b/src/gui/embedded/qscreenmulti_qws.cpp
index beeb6aa..3a23ca2 100644
--- a/src/gui/embedded/qscreenmulti_qws.cpp
+++ b/src/gui/embedded/qscreenmulti_qws.cpp
@@ -46,6 +46,7 @@
#include <qlist.h>
#include <qstringlist.h>
#include <qwidget.h>
+#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -230,6 +231,9 @@ bool QMultiScreen::connect(const QString &displaySpec)
QStringList specs = dSpec.split(QLatin1Char(' '), QString::SkipEmptyParts);
foreach (QString spec, specs) {
const int id = getDisplayId(spec);
+ if (spec.startsWith("vnc:", Qt::CaseInsensitive)) {
+ spec.append(":noDisablePainting");
+ }
const QPoint offset = filterDisplayOffset(spec);
QScreen *s = qt_get_screen(id, spec.toLatin1().constData());
s->setOffset(offset);
diff --git a/src/plugins/gfxdrivers/vnc/qscreenvnc_p.h b/src/plugins/gfxdrivers/vnc/qscreenvnc_p.h
index 9aad8f7..d7466d2 100644
--- a/src/plugins/gfxdrivers/vnc/qscreenvnc_p.h
+++ b/src/plugins/gfxdrivers/vnc/qscreenvnc_p.h
@@ -259,6 +259,8 @@ public:
#endif
QVNCScreen *q_ptr;
+
+ bool noDisablePainting;
};
class QRfbEncoder
diff --git a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
index e177f98..f28e160 100644
--- a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
+++ b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp
@@ -195,8 +195,11 @@ void QVNCClientCursor::write() const
QVNCScreenPrivate::QVNCScreenPrivate(QVNCScreen *parent)
: dpiX(72), dpiY(72), doOnScreenSurface(false), refreshRate(25),
- vncServer(0), q_ptr(parent)
+ vncServer(0), q_ptr(parent), noDisablePainting(false)
{
+#ifdef QT_BUILD_INTERNAL
+ noDisablePainting = (qgetenv("QT_VNC_NO_DISABLEPAINTING").toInt() <=0);
+#endif
#ifndef QT_NO_QWS_SIGNALHANDLER
QWSSignalHandler::instance()->addObject(this);
#endif
@@ -615,7 +618,7 @@ void QVNCServer::newConnection()
client->write(proto, 12);
state = Protocol;
- if (!qvnc_screen->screen())
+ if (!qvnc_screen->screen() && !qvnc_screen->d_ptr->noDisablePainting)
QWSServer::instance()->enablePainting(true);
}
@@ -2001,7 +2004,7 @@ void QVNCServer::discardClient()
delete qvnc_cursor;
qvnc_cursor = 0;
#endif
- if (!qvnc_screen->screen())
+ if (!qvnc_screen->screen() && !qvnc_screen->d_ptr->noDisablePainting)
QWSServer::instance()->enablePainting(false);
}
@@ -2184,6 +2187,9 @@ bool QVNCScreen::connect(const QString &displaySpec)
d_ptr->dpiY = (dpiY > 0 ? dpiY : dpiX);
}
+ if (args.contains(QLatin1String("noDisablePainting")))
+ d_ptr->noDisablePainting = true;
+
QWSServer::setDefaultMouse("None");
QWSServer::setDefaultKeyboard("None");
@@ -2273,11 +2279,9 @@ bool QVNCScreen::initDevice()
if (QProxyScreen::screen())
return ok;
-#ifdef QT_BUILD_INTERNAL
- if (qgetenv("QT_VNC_NO_DISABLEPAINTING").toInt() <= 0)
-#endif
- // No need to do painting while there's no clients attached
- QWSServer::instance()->enablePainting(false);
+ // Disable painting if there is only 1 display and nothing is attached to the VNC server
+ if (!d_ptr->noDisablePainting)
+ QWSServer::instance()->enablePainting(false);
return true;
}