Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11events.c @ 4264:d6f4cc9a5bf6 SDL-1.2
Batch x11 dga mouse motion events into a single SDL event.
Untested attempt to fix Bugzilla #609. Do not merge into 1.3 in any case.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Tue, 29 Sep 2009 11:28:43 +0000 |
parents | 5a203e2b0162 |
children | 60db3d01cb3a |
comparison
equal
deleted
inserted
replaced
4263:3c12d2e84bcb | 4264:d6f4cc9a5bf6 |
---|---|
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 posted = SDL_PrivateMouseMotion(0, 1, | 518 /* batch DGA motion into one event, queued later. */ |
519 xevent.xmotion.x_root, | 519 dga_x += xevent.xmotion.x_root; |
520 xevent.xmotion.y_root); | 520 dga_y += 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 | |
934 if ( switch_waiting ) { | 944 if ( switch_waiting ) { |
935 Uint32 now; | 945 Uint32 now; |
936 | 946 |
937 now = SDL_GetTicks(); | 947 now = SDL_GetTicks(); |
938 if ( pending || !SDL_VideoSurface ) { | 948 if ( pending || !SDL_VideoSurface ) { |