src/video/x11/SDL_x11events.c
branchgsoc2008_manymouse
changeset 3764 2970fcfbdd54
parent 3763 81ea7d9a6624
child 3772 9087a84cba51
equal deleted inserted replaced
3763:81ea7d9a6624 3764:2970fcfbdd54
    35 extern int motion;
    35 extern int motion;
    36 extern int button_pressed;
    36 extern int button_pressed;
    37 extern int button_released;
    37 extern int button_released;
    38 extern int proximity_in;
    38 extern int proximity_in;
    39 extern int proximity_out;
    39 extern int proximity_out;
       
    40 extern int x_max,y_max;
    40 
    41 
    41 
    42 
    42 static void
    43 static void
    43 X11_DispatchEvent(_THIS)
    44 X11_DispatchEvent(_THIS)
    44 {
    45 {
   124 #endif
   125 #endif
   125             if ((xevent.xcrossing.mode != NotifyGrab) &&
   126             if ((xevent.xcrossing.mode != NotifyGrab) &&
   126                 (xevent.xcrossing.mode != NotifyUngrab) &&
   127                 (xevent.xcrossing.mode != NotifyUngrab) &&
   127                 (xevent.xcrossing.detail != NotifyInferior)) {
   128                 (xevent.xcrossing.detail != NotifyInferior)) {
   128 			    XDeviceMotionEvent* move=(XDeviceMotionEvent*)&xevent;
   129 			    XDeviceMotionEvent* move=(XDeviceMotionEvent*)&xevent;
   129                 SDL_SendMouseMotion(move->deviceid, 0,
   130                 //SDL_SendMouseMotion(move->deviceid, 0,
   130                                     move->x, move->y,move->axis_data[2]);
   131                 //                    move->x, move->y,move->axis_data[2]);
   131                 SDL_SetMouseFocus(move->deviceid, 0);
   132                 SDL_SetMouseFocus(move->deviceid, 0);
   132             }
   133             }
   133         }
   134         }
   134         break;
   135         break;
   135 
   136 
   295             if(xevent.type==motion)//MotionNotify
   296             if(xevent.type==motion)//MotionNotify
   296             {
   297             {
   297 #ifdef DEBUG_MOTION
   298 #ifdef DEBUG_MOTION
   298                 printf("X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y);
   299                 printf("X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y);
   299 #endif
   300 #endif
       
   301                 XWindowAttributes attrib;
       
   302                 XGetWindowAttributes(videodata->display, ((XAnyEvent*)&xevent)->window, &attrib);
       
   303                 /*x_max=attrib.width;
       
   304                 y_max=attrib.height;*/
       
   305                 SDL_UpdateCoordinates(attrib.width, attrib.height);
   300 			    XDeviceMotionEvent* move=(XDeviceMotionEvent*)&xevent;
   306 			    XDeviceMotionEvent* move=(XDeviceMotionEvent*)&xevent;
   301                 SDL_SendMouseMotion(move->deviceid, 0, move->x,
   307                 SDL_SendMouseMotion(move->deviceid, 0, move->x,
   302                                 move->y,move->axis_data[2]);
   308                                 move->y,move->axis_data[2]);
   303             }
   309             }
   304     /*
   310     /*