src/video/x11/SDL_x11events.c
branchgsoc2008_manymouse
changeset 3764 2970fcfbdd54
parent 3763 81ea7d9a6624
child 3772 9087a84cba51
     1.1 --- a/src/video/x11/SDL_x11events.c	Wed Jul 02 20:29:29 2008 +0000
     1.2 +++ b/src/video/x11/SDL_x11events.c	Thu Jul 03 22:03:58 2008 +0000
     1.3 @@ -37,6 +37,7 @@
     1.4  extern int button_released;
     1.5  extern int proximity_in;
     1.6  extern int proximity_out;
     1.7 +extern int x_max,y_max;
     1.8  
     1.9  
    1.10  static void
    1.11 @@ -126,8 +127,8 @@
    1.12                  (xevent.xcrossing.mode != NotifyUngrab) &&
    1.13                  (xevent.xcrossing.detail != NotifyInferior)) {
    1.14  			    XDeviceMotionEvent* move=(XDeviceMotionEvent*)&xevent;
    1.15 -                SDL_SendMouseMotion(move->deviceid, 0,
    1.16 -                                    move->x, move->y,move->axis_data[2]);
    1.17 +                //SDL_SendMouseMotion(move->deviceid, 0,
    1.18 +                //                    move->x, move->y,move->axis_data[2]);
    1.19                  SDL_SetMouseFocus(move->deviceid, 0);
    1.20              }
    1.21          }
    1.22 @@ -297,6 +298,11 @@
    1.23  #ifdef DEBUG_MOTION
    1.24                  printf("X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y);
    1.25  #endif
    1.26 +                XWindowAttributes attrib;
    1.27 +                XGetWindowAttributes(videodata->display, ((XAnyEvent*)&xevent)->window, &attrib);
    1.28 +                /*x_max=attrib.width;
    1.29 +                y_max=attrib.height;*/
    1.30 +                SDL_UpdateCoordinates(attrib.width, attrib.height);
    1.31  			    XDeviceMotionEvent* move=(XDeviceMotionEvent*)&xevent;
    1.32                  SDL_SendMouseMotion(move->deviceid, 0, move->x,
    1.33                                  move->y,move->axis_data[2]);