summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/vnc/qvncscreen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/vnc/qvncscreen.cpp')
-rw-r--r--src/plugins/platforms/vnc/qvncscreen.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/plugins/platforms/vnc/qvncscreen.cpp b/src/plugins/platforms/vnc/qvncscreen.cpp
index 64f1bc0bf7..cd43ce4e69 100644
--- a/src/plugins/platforms/vnc/qvncscreen.cpp
+++ b/src/plugins/platforms/vnc/qvncscreen.cpp
@@ -58,8 +58,10 @@ QVncScreen::QVncScreen(const QStringList &args)
QVncScreen::~QVncScreen()
{
+#if QT_CONFIG(cursor)
if (clientCursor)
delete clientCursor;
+#endif
}
bool QVncScreen::initialize()
@@ -120,17 +122,21 @@ QRegion QVncScreen::doRedraw()
return touched;
}
+
void QVncScreen::enableClientCursor(QVncClient *client)
{
+#if QT_CONFIG(cursor)
delete mCursor;
mCursor = nullptr;
if (!clientCursor)
clientCursor = new QVncClientCursor();
clientCursor->addClient(client);
+#endif
}
void QVncScreen::disableClientCursor(QVncClient *client)
{
+#if QT_CONFIG(cursor)
uint clientCount = clientCursor->removeClient(client);
if (clientCount == 0) {
delete clientCursor;
@@ -138,11 +144,16 @@ void QVncScreen::disableClientCursor(QVncClient *client)
}
mCursor = new QFbCursor(this);
+#endif
}
QPlatformCursor *QVncScreen::cursor() const
{
+#if QT_CONFIG(cursor)
return mCursor ? static_cast<QPlatformCursor *>(mCursor) : static_cast<QPlatformCursor *>(clientCursor);
+#else
+ return nullptr;
+#endif
}
// grabWindow() grabs "from the screen" not from the backingstores.
@@ -151,10 +162,10 @@ QPixmap QVncScreen::grabWindow(WId wid, int x, int y, int width, int height) con
{
if (!wid) {
if (width < 0)
- width = mScreenImage->width() - x;
+ width = mScreenImage.width() - x;
if (height < 0)
- height = mScreenImage->height() - y;
- return QPixmap::fromImage(*mScreenImage).copy(x, y, width, height);
+ height = mScreenImage.height() - y;
+ return QPixmap::fromImage(mScreenImage).copy(x, y, width, height);
}
QFbWindow *window = windowForId(wid);
@@ -166,7 +177,7 @@ QPixmap QVncScreen::grabWindow(WId wid, int x, int y, int width, int height) con
height = geom.height() - y;
QRect rect(geom.topLeft() + QPoint(x, y), QSize(width, height));
rect &= window->geometry();
- return QPixmap::fromImage(*mScreenImage).copy(rect);
+ return QPixmap::fromImage(mScreenImage).copy(rect);
}
return QPixmap();
@@ -188,5 +199,10 @@ bool QVncScreen::swapBytes() const
}
#endif
+QFbScreen::Flags QVncScreen::flags() const
+{
+ return QFbScreen::DontForceFirstWindowToFullScreen;
+}
+
QT_END_NAMESPACE