return;
}
- startQuitting();
-
emit errorMessage(i18n("VNC failure"), message);
+
+ startQuitting();
}
void VncView::updateImage(int x, int y, int w, int h)
magnification = (level)/90.0*(1.0 - fit_screen_magnification) + fit_screen_magnification;
}
- if(magnification < 0 //remote display smaller than local?
- or magnification != magnification) //nan
+ //remote display smaller than local (or NAN)?
+ if(magnification < 0 or magnification != magnification)
magnification = 1.0;
- m_verticalFactor = m_horizontalFactor = magnification;
+ m_verticalFactor = m_horizontalFactor = magnification;
resize(m_frame.width()*magnification, m_frame.height()*magnification);
}
//split update region into smaller non-intersecting rectangles and only paint those
QPainter painter(this);
- foreach(const QRect& update_rect, event->region().rects()) {
+ foreach(QRect update_rect, event->region().rects()) {
+ if(m_horizontalFactor == 2.0 and m_verticalFactor == 2.0) {
+ //grow client side updates to multiples of 2 to avoid artifacts
+ update_rect.adjust(
+ -update_rect.x()%2,
+ -update_rect.y()%2,
+ 0, 0);
+ update_rect.adjust(0, 0,
+ (update_rect.x()+update_rect.width())%2,
+ (update_rect.y()+update_rect.height())%2);
+ }
const int sx = qRound(update_rect.x()/m_horizontalFactor);
const int sy = qRound(update_rect.y()/m_verticalFactor);
const int sw = qRound(update_rect.width()/m_horizontalFactor);
return;
}
-// parts of this code are based on http://italc.sourcearchive.com/documentation/1.0.9.1/vncview_8cpp-source.html
+ // parts of this code are based on http://italc.sourcearchive.com/documentation/1.0.9.1/vncview_8cpp-source.html
rfbKeySym k = e->nativeVirtualKey();
+
// we do not handle Key_Backtab separately as the Shift-modifier
// is already enabled
if (e->key() == Qt::Key_Backtab) {
else if(e->key() == Qt::Key_F7)
current_zoom = right_zoom;
else if (k) {
- // kDebug(5011) << "got '" << e->text() << "'.";
+ //kDebug(5011) << "got '" << e->text() << "', nativeVirtualKey: " << k;
vncThread.keyEvent(k, pressed);
} else {
kDebug(5011) << "nativeVirtualKey() for '" << e->text() << "' failed.";
k = 0xff67;
break;
case Qt::Key_Meta:
- case Qt::MetaModifier:
k = XK_Super_L;
break;
case Qt::Key_Alt:
- case Qt::AltModifier:
k = XK_Alt_L;
break;
case Qt::Key_Control:
- case Qt::ControlModifier:
k = XK_Control_L;
break;
default:
Q_ASSERT(keys.count() <= 1); //we can only handle a single combination
//to get at individual key presses, we split 'keys' into its components
- QList<int> key_list;
+ QList<Qt::Key> key_list;
int pos = 0;
while(true) {
QString k = keys.toString().section('+', pos, pos);
} else if(k == "Meta") {
key_list.append(Qt::Key_Meta);
} else {
- key_list.append(QKeySequence(k)[0]);
+ key_list.append((Qt::Key)QKeySequence(k)[0]);
}
pos++;
}
for(int i = 0; i < key_list.count(); i++)
- sendKey(Qt::Key(key_list.at(i)));
+ sendKey(key_list.at(i));
//release modifiers (everything before final key)
for(int i = key_list.count()-2; i >= 0; i--)
- sendKey(Qt::Key(key_list.at(i)));
+ sendKey(key_list.at(i));
}
void VncView::reloadSettings()