2cc4dbf1a2
[ #457968 ] Strange mouse motion on RFB
75 lines
1.9 KiB
Plaintext
75 lines
1.9 KiB
Plaintext
? Makefile
|
|
Index: rfb.cc
|
|
===================================================================
|
|
RCS file: /cvsroot/bochs/bochs/gui/rfb.cc,v
|
|
retrieving revision 1.10
|
|
diff -c -r1.10 rfb.cc
|
|
*** rfb.cc 2001/06/23 03:18:14 1.10
|
|
--- rfb.cc 2001/09/03 08:24:36
|
|
***************
|
|
*** 214,220 ****
|
|
SOCKET sServer;
|
|
SOCKET sClient;
|
|
struct sockaddr_in sai;
|
|
! int sai_size;
|
|
|
|
#ifdef WIN32
|
|
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);
|
|
--- 214,220 ----
|
|
SOCKET sServer;
|
|
SOCKET sClient;
|
|
struct sockaddr_in sai;
|
|
! unsigned int sai_size;
|
|
|
|
#ifdef WIN32
|
|
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);
|
|
***************
|
|
*** 243,249 ****
|
|
fprintf(stderr, "# RFB: listening for connections on port %i.\n", rfbPort);
|
|
sai_size = sizeof(sai);
|
|
while(keep_alive) {
|
|
! sClient = accept(sServer, (struct sockaddr *)&sai, &sai_size);
|
|
if(sClient != -1) {
|
|
HandleRfbClient(sClient);
|
|
sGlobal = -1;
|
|
--- 243,249 ----
|
|
fprintf(stderr, "# RFB: listening for connections on port %i.\n", rfbPort);
|
|
sai_size = sizeof(sai);
|
|
while(keep_alive) {
|
|
! sClient = accept(sServer, (struct sockaddr *)&sai, (socklen_t*)&sai_size);
|
|
if(sClient != -1) {
|
|
HandleRfbClient(sClient);
|
|
sGlobal = -1;
|
|
***************
|
|
*** 1256,1264 ****
|
|
|
|
void rfbMouseMove(int x, int y, int bmask)
|
|
{
|
|
int buttons = 0;
|
|
if(y > rfbHeaderbarY) {
|
|
! bx_devices.keyboard->mouse_motion(x, y - rfbHeaderbarY, buttons);
|
|
}
|
|
}
|
|
|
|
--- 1256,1275 ----
|
|
|
|
void rfbMouseMove(int x, int y, int bmask)
|
|
{
|
|
+ static int oldx = -1;
|
|
+ static int oldy = -1;
|
|
int buttons = 0;
|
|
+
|
|
+ if (oldx == oldy == -1) {
|
|
+ oldx = x;
|
|
+ oldy = y;
|
|
+ return;
|
|
+ }
|
|
if(y > rfbHeaderbarY) {
|
|
! //bx_devices.keyboard->mouse_motion(x, y - rfbHeaderbarY, buttons);
|
|
! bx_devices.keyboard->mouse_motion(x - oldx, oldy - y, bmask);
|
|
! oldx = x;
|
|
! oldy = y;
|
|
}
|
|
}
|
|
|