diff src/video/x11/SDL_x11events.c @ 3764:2970fcfbdd54 gsoc2008_manymouse

Relative mode for tablets. Info on wiki.
author Szymon Wilczek <kazeuser@gmail.com>
date Thu, 03 Jul 2008 22:03:58 +0000
parents 81ea7d9a6624
children 9087a84cba51
line wrap: on
line diff
--- a/src/video/x11/SDL_x11events.c	Wed Jul 02 20:29:29 2008 +0000
+++ b/src/video/x11/SDL_x11events.c	Thu Jul 03 22:03:58 2008 +0000
@@ -37,6 +37,7 @@
 extern int button_released;
 extern int proximity_in;
 extern int proximity_out;
+extern int x_max,y_max;
 
 
 static void
@@ -126,8 +127,8 @@
                 (xevent.xcrossing.mode != NotifyUngrab) &&
                 (xevent.xcrossing.detail != NotifyInferior)) {
 			    XDeviceMotionEvent* move=(XDeviceMotionEvent*)&xevent;
-                SDL_SendMouseMotion(move->deviceid, 0,
-                                    move->x, move->y,move->axis_data[2]);
+                //SDL_SendMouseMotion(move->deviceid, 0,
+                //                    move->x, move->y,move->axis_data[2]);
                 SDL_SetMouseFocus(move->deviceid, 0);
             }
         }
@@ -297,6 +298,11 @@
 #ifdef DEBUG_MOTION
                 printf("X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y);
 #endif
+                XWindowAttributes attrib;
+                XGetWindowAttributes(videodata->display, ((XAnyEvent*)&xevent)->window, &attrib);
+                /*x_max=attrib.width;
+                y_max=attrib.height;*/
+                SDL_UpdateCoordinates(attrib.width, attrib.height);
 			    XDeviceMotionEvent* move=(XDeviceMotionEvent*)&xevent;
                 SDL_SendMouseMotion(move->deviceid, 0, move->x,
                                 move->y,move->axis_data[2]);