Changeset View
Changeset View
Standalone View
Standalone View
vnc/vncclientthread.cpp
Show First 20 Lines • Show All 203 Lines • ▼ Show 20 Line(s) | 187 | // qCDebug(KRDC) << "updated client: x: " << x << ", y: " << y << ", w: " << w << ", h: " << h; | |||
---|---|---|---|---|---|
204 | if (img.isNull()) { | 204 | if (img.isNull()) { | ||
205 | qCDebug(KRDC) << "image not loaded"; | 205 | qCDebug(KRDC) << "image not loaded"; | ||
206 | } | 206 | } | ||
207 | 207 | | |||
208 | if (m_stopped) { | 208 | if (m_stopped) { | ||
209 | return; // sending data to a stopped thread is not a good idea | 209 | return; // sending data to a stopped thread is not a good idea | ||
210 | } | 210 | } | ||
211 | 211 | | |||
212 | img.setDevicePixelRatio(m_devicePixelRatio); | ||||
212 | setImage(img); | 213 | setImage(img); | ||
213 | 214 | | |||
214 | emitUpdated(x, y, w, h); | 215 | emitUpdated(x, y, w, h); | ||
215 | } | 216 | } | ||
216 | 217 | | |||
217 | void VncClientThread::cuttext(const char *text, int textlen) | 218 | void VncClientThread::cuttext(const char *text, int textlen) | ||
218 | { | 219 | { | ||
219 | const QString cutText = QString::fromUtf8(text, textlen); | 220 | const QString cutText = QString::fromUtf8(text, textlen); | ||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | 264 | { | |||
318 | if (message.contains(QLatin1String("VNC server supports protocol version 3.889"))) // see https://bugs.kde.org/162640 | 319 | if (message.contains(QLatin1String("VNC server supports protocol version 3.889"))) // see https://bugs.kde.org/162640 | ||
319 | outputErrorMessageString = QLatin1String("INTERNAL:APPLE_VNC_COMPATIBILTY"); | 320 | outputErrorMessageString = QLatin1String("INTERNAL:APPLE_VNC_COMPATIBILTY"); | ||
320 | } | 321 | } | ||
321 | 322 | | |||
322 | VncClientThread::VncClientThread(QObject *parent) | 323 | VncClientThread::VncClientThread(QObject *parent) | ||
323 | : QThread(parent) | 324 | : QThread(parent) | ||
324 | , frameBuffer(nullptr) | 325 | , frameBuffer(nullptr) | ||
325 | , cl(nullptr) | 326 | , cl(nullptr) | ||
327 | , m_devicePixelRatio(1.0) | ||||
326 | , m_stopped(false) | 328 | , m_stopped(false) | ||
327 | { | 329 | { | ||
328 | // We choose a small value for interval...after all if the connection is | 330 | // We choose a small value for interval...after all if the connection is | ||
329 | // supposed to sustain a VNC session, a reasonably frequent ping should | 331 | // supposed to sustain a VNC session, a reasonably frequent ping should | ||
330 | // be perfectly supportable. | 332 | // be perfectly supportable. | ||
331 | m_keepalive.intervalSeconds = 1; | 333 | m_keepalive.intervalSeconds = 1; | ||
332 | m_keepalive.failedProbes = 3; | 334 | m_keepalive.failedProbes = 3; | ||
333 | m_keepalive.set = false; | 335 | m_keepalive.set = false; | ||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 393 | case RemoteView::High: | |||
392 | setColorDepth(bpp32); | 394 | setColorDepth(bpp32); | ||
393 | break; | 395 | break; | ||
394 | case RemoteView::Medium: | 396 | case RemoteView::Medium: | ||
395 | default: | 397 | default: | ||
396 | setColorDepth(bpp16); | 398 | setColorDepth(bpp16); | ||
397 | } | 399 | } | ||
398 | } | 400 | } | ||
399 | 401 | | |||
402 | void VncClientThread::setDevicePixelRatio(qreal dpr) | ||||
403 | { | ||||
404 | m_devicePixelRatio = dpr; | ||||
405 | } | ||||
406 | | ||||
400 | void VncClientThread::setColorDepth(ColorDepth colorDepth) | 407 | void VncClientThread::setColorDepth(ColorDepth colorDepth) | ||
401 | { | 408 | { | ||
402 | m_colorDepth= colorDepth; | 409 | m_colorDepth= colorDepth; | ||
403 | } | 410 | } | ||
404 | 411 | | |||
405 | RemoteView::Quality VncClientThread::quality() const | 412 | RemoteView::Quality VncClientThread::quality() const | ||
406 | { | 413 | { | ||
407 | return m_quality; | 414 | return m_quality; | ||
▲ Show 20 Lines • Show All 270 Lines • Show Last 20 Lines |