Diffstat (limited to 'noncore/comm/keypebble/krfbdecoder.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/comm/keypebble/krfbdecoder.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp index a964c09..94e3b79 100644 --- a/noncore/comm/keypebble/krfbdecoder.cpp +++ b/noncore/comm/keypebble/krfbdecoder.cpp | |||
@@ -186,25 +186,25 @@ void KRFBDecoder::gotServerInit() | |||
186 | 186 | ||
187 | con->read( &(info->nameLength), 4 ); | 187 | con->read( &(info->nameLength), 4 ); |
188 | info->nameLength = Swap32IfLE( info->nameLength ); | 188 | info->nameLength = Swap32IfLE( info->nameLength ); |
189 | 189 | ||
190 | qWarning( "Width = %d, Height = %d", info->width, info->height ); | 190 | qWarning( "Width = %d, Height = %d", info->width, info->height ); |
191 | qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d", | 191 | qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d", |
192 | info->bpp, info->depth, info->bigEndian, info->trueColor ); | 192 | info->bpp, info->depth, info->bigEndian, info->trueColor ); |
193 | qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d", | 193 | qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d", |
194 | info->redMax, info->greenMax, info->blueMax ); | 194 | info->redMax, info->greenMax, info->blueMax ); |
195 | qWarning( "RedShift = %d, GreenShift = %d, BlueShift = %d", | 195 | qWarning( "RedShift = %d, GreenShift = %d, BlueShift = %d", |
196 | info->redShift, info->greenShift,info-> blueShift ); | 196 | info->redShift, info->greenShift,info-> blueShift ); |
197 | 197 | ||
198 | buf->resize( info->width, info->height ); | 198 | buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor); |
199 | 199 | ||
200 | // Wait for desktop name | 200 | // Wait for desktop name |
201 | qWarning( "Waiting for desktop name" ); | 201 | qWarning( "Waiting for desktop name" ); |
202 | 202 | ||
203 | static QString statusMsg = tr( "Waiting for desktop name..." ); | 203 | static QString statusMsg = tr( "Waiting for desktop name..." ); |
204 | emit status( statusMsg ); | 204 | emit status( statusMsg ); |
205 | 205 | ||
206 | currentState = AwaitingDesktopName; | 206 | currentState = AwaitingDesktopName; |
207 | connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) ); | 207 | connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) ); |
208 | con->waitForData( info->nameLength ); | 208 | con->waitForData( info->nameLength ); |
209 | } | 209 | } |
210 | 210 | ||
@@ -633,26 +633,27 @@ void KRFBDecoder::sendMouseEvent( QMouseEvent *e ) | |||
633 | buttonMask |= 0x02; | 633 | buttonMask |= 0x02; |
634 | } | 634 | } |
635 | else if ( e->type() == QEvent::MouseButtonRelease ) { | 635 | else if ( e->type() == QEvent::MouseButtonRelease ) { |
636 | if ( e->button() & LeftButton ) | 636 | if ( e->button() & LeftButton ) |
637 | buttonMask &= 0x06; | 637 | buttonMask &= 0x06; |
638 | if ( e->button() & MidButton ) | 638 | if ( e->button() & MidButton ) |
639 | buttonMask |= 0x03; | 639 | buttonMask |= 0x03; |
640 | if ( e->button() & RightButton ) | 640 | if ( e->button() & RightButton ) |
641 | buttonMask |= 0x05; | 641 | buttonMask |= 0x05; |
642 | } | 642 | } |
643 | } | 643 | } |
644 | 644 | ||
645 | CARD16 x = Swap16IfLE( e->x() ); | 645 | // HACK: Scaling |
646 | CARD16 y = Swap16IfLE( e->y() ); | 646 | CARD16 x = Swap16IfLE( e->x() * con->options()->scaleFactor ); |
647 | CARD16 y = Swap16IfLE( e->y() *con->options()->scaleFactor ); | ||
647 | 648 | ||
648 | con->write( &PointerEventId, 1 ); | 649 | con->write( &PointerEventId, 1 ); |
649 | con->write( &buttonMask, 1 ); | 650 | con->write( &buttonMask, 1 ); |
650 | con->write( &x, 2 ); | 651 | con->write( &x, 2 ); |
651 | con->write( &y, 2 ); | 652 | con->write( &y, 2 ); |
652 | } | 653 | } |
653 | 654 | ||
654 | 655 | ||
655 | void KRFBDecoder::sendCutEvent( const QString &unicode ) | 656 | void KRFBDecoder::sendCutEvent( const QString &unicode ) |
656 | { | 657 | { |
657 | // | 658 | // |
658 | // Warning: There is a bug in the RFB protocol because there is no way to find | 659 | // Warning: There is a bug in the RFB protocol because there is no way to find |