# HG changeset patch # User Sam Lantinga # Date 1295481735 28800 # Node ID 8c39b82dc7b01cf80d43bad0f3e68b5950555fe1 # Parent 3ce345cc46f83218fb079648258c3bbb742bbf94 Window move events have the same problem as size events on Windows diff -r 3ce345cc46f8 -r 8c39b82dc7b0 src/events/SDL_windowevents.c --- a/src/events/SDL_windowevents.c Wed Jan 19 15:28:01 2011 -0800 +++ b/src/events/SDL_windowevents.c Wed Jan 19 16:02:15 2011 -0800 @@ -43,6 +43,20 @@ return 1; } +static int +RemovePendingMoveEvents(void * userdata, SDL_Event *event) +{ + SDL_Event *new_event = (SDL_Event *)userdata; + + if (event->type == SDL_WINDOWEVENT && + event->window.event == SDL_WINDOWEVENT_MOVED && + event->window.windowID == new_event->window.windowID) { + /* We're about to post a new move event, drop the old one */ + return 0; + } + return 1; +} + int SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1, int data2) @@ -156,6 +170,9 @@ if (windowevent == SDL_WINDOWEVENT_RESIZED) { SDL_FilterEvents(RemovePendingSizeEvents, &event); } + if (windowevent == SDL_WINDOWEVENT_MOVED) { + SDL_FilterEvents(RemovePendingMoveEvents, &event); + } posted = (SDL_PushEvent(&event) > 0); }