mirror of
https://github.com/yawut/SDL.git
synced 2026-10-01 20:56:44 -05:00
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. --HG-- branch : SDL-1.2
This commit is contained in:
@@ -515,9 +515,9 @@ printf("KeymapNotify!\n");
|
||||
#ifdef DEBUG_MOTION
|
||||
printf("DGA motion: %d,%d\n", xevent.xmotion.x_root, xevent.xmotion.y_root);
|
||||
#endif
|
||||
posted = SDL_PrivateMouseMotion(0, 1,
|
||||
xevent.xmotion.x_root,
|
||||
xevent.xmotion.y_root);
|
||||
/* batch DGA motion into one event, queued later. */
|
||||
dga_x += xevent.xmotion.x_root;
|
||||
dga_y += xevent.xmotion.y_root;
|
||||
} else {
|
||||
posted = X11_WarpedMotion(this,&xevent);
|
||||
}
|
||||
@@ -931,6 +931,16 @@ void X11_PumpEvents(_THIS)
|
||||
X11_DispatchEvent(this);
|
||||
++pending;
|
||||
}
|
||||
|
||||
/* We batch up all the DGA motion events and generate a single SDL
|
||||
event from them, since newer x.org releases might send a LOT of
|
||||
these at once and flood the SDL event queue. --ryan. */
|
||||
if (dga_x || dga_y) {
|
||||
SDL_PrivateMouseMotion(0, 1, dga_x, dga_y);
|
||||
dga_x = 0;
|
||||
dga_y = 0;
|
||||
}
|
||||
|
||||
if ( switch_waiting ) {
|
||||
Uint32 now;
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ struct SDL_PrivateVideoData {
|
||||
|
||||
/* Direct Graphics Access extension information */
|
||||
int using_dga;
|
||||
Sint16 dga_x;
|
||||
Sint16 dga_y;
|
||||
|
||||
#ifndef NO_SHARED_MEMORY
|
||||
/* MIT shared memory extension information */
|
||||
@@ -172,6 +174,8 @@ struct SDL_PrivateVideoData {
|
||||
#define SDL_IC (this->hidden->X11_IC)
|
||||
#define SDL_windowid (this->hidden->SDL_windowid)
|
||||
#define using_dga (this->hidden->using_dga)
|
||||
#define dga_x (this->hidden->dga_x)
|
||||
#define dga_y (this->hidden->dga_y)
|
||||
#define use_mitshm (this->hidden->use_mitshm)
|
||||
#define shminfo (this->hidden->shminfo)
|
||||
#define SDL_Ximage (this->hidden->Ximage)
|
||||
|
||||
Reference in New Issue
Block a user