Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11events.c @ 4269:60db3d01cb3a SDL-1.2
I just tested DGA mouse motion with X.org 1.6.0 and it's working fine,
with evdev and the G5 mouse. It's not creating a ton of events here.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 30 Sep 2009 04:49:57 +0000 |
parents | d6f4cc9a5bf6 |
children | 4aa31b9207f2 |
comparison
equal
deleted
inserted
replaced
4268:d48035d857d3 | 4269:60db3d01cb3a |
---|---|
513 if ( mouse_relative ) { | 513 if ( mouse_relative ) { |
514 if ( using_dga & DGA_MOUSE ) { | 514 if ( using_dga & DGA_MOUSE ) { |
515 #ifdef DEBUG_MOTION | 515 #ifdef DEBUG_MOTION |
516 printf("DGA motion: %d,%d\n", xevent.xmotion.x_root, xevent.xmotion.y_root); | 516 printf("DGA motion: %d,%d\n", xevent.xmotion.x_root, xevent.xmotion.y_root); |
517 #endif | 517 #endif |
518 /* batch DGA motion into one event, queued later. */ | 518 posted = SDL_PrivateMouseMotion(0, 1, |
519 dga_x += xevent.xmotion.x_root; | 519 xevent.xmotion.x_root, |
520 dga_y += xevent.xmotion.y_root; | 520 xevent.xmotion.y_root); |
521 } else { | 521 } else { |
522 posted = X11_WarpedMotion(this,&xevent); | 522 posted = X11_WarpedMotion(this,&xevent); |
523 } | 523 } |
524 } else { | 524 } else { |
525 #ifdef DEBUG_MOTION | 525 #ifdef DEBUG_MOTION |
929 pending = 0; | 929 pending = 0; |
930 while ( X11_Pending(SDL_Display) ) { | 930 while ( X11_Pending(SDL_Display) ) { |
931 X11_DispatchEvent(this); | 931 X11_DispatchEvent(this); |
932 ++pending; | 932 ++pending; |
933 } | 933 } |
934 | |
935 /* We batch up all the DGA motion events and generate a single SDL | |
936 event from them, since newer x.org releases might send a LOT of | |
937 these at once and flood the SDL event queue. --ryan. */ | |
938 if (dga_x || dga_y) { | |
939 SDL_PrivateMouseMotion(0, 1, dga_x, dga_y); | |
940 dga_x = 0; | |
941 dga_y = 0; | |
942 } | |
943 | |
944 if ( switch_waiting ) { | 934 if ( switch_waiting ) { |
945 Uint32 now; | 935 Uint32 now; |
946 | 936 |
947 now = SDL_GetTicks(); | 937 now = SDL_GetTicks(); |
948 if ( pending || !SDL_VideoSurface ) { | 938 if ( pending || !SDL_VideoSurface ) { |