Skip to content

Commit

Permalink
Fix build with -no-feature-cursor
Browse files Browse the repository at this point in the history
Change-Id: I0644342c56facefab611f981690d0c7a2a460e7e
Reviewed-by: Laszlo Agocs <[email protected]>
  • Loading branch information
xknight committed Nov 8, 2016
1 parent 969bb10 commit 14805de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/plugins/platforms/vnc/qvnc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,11 @@ void QRfbRawEncoder::write()

QVncClientCursor::QVncClientCursor()
{
#ifndef QT_NO_CURSOR
QWindow *w = QGuiApplication::focusWindow();
QCursor c = w ? w->cursor() : QCursor(Qt::ArrowCursor);
changeCursor(&c, 0);
#endif
}

QVncClientCursor::~QVncClientCursor()
Expand Down Expand Up @@ -582,10 +584,10 @@ void QVncClientCursor::write(QVncClient *client) const
socket->write((const char*)bitmap.scanLine(i), width);
}

#ifndef QT_NO_CURSOR
void QVncClientCursor::changeCursor(QCursor *widgetCursor, QWindow *window)
{
Q_UNUSED(window);
#ifndef QT_NO_CURSOR
const Qt::CursorShape shape = widgetCursor ? widgetCursor->shape() : Qt::ArrowCursor;

if (shape == Qt::BitmapCursor) {
Expand All @@ -599,6 +601,9 @@ void QVncClientCursor::changeCursor(QCursor *widgetCursor, QWindow *window)
cursor = *platformImage.image();
hotspot = platformImage.hotspot();
}
#else // !QT_NO_CURSOR
Q_UNUSED(widgetCursor);
#endif
for (auto client : clients)
client->setDirtyCursor();
}
Expand All @@ -614,7 +619,6 @@ uint QVncClientCursor::removeClient(QVncClient *client)
clients.removeOne(client);
return clients.count();
}
#endif

QVncServer::QVncServer(QVncScreen *screen, quint16 port)
: qvnc_screen(screen)
Expand Down

0 comments on commit 14805de

Please sign in to comment.