Reset the mouse button state when losing mouse focus.

Implemented mouse focus handling entirely using mouse motion events, with SetCapture() semantics, as long as the windowing system continues to provide mouse events.
This commit is contained in:
Sam Lantinga 2012-11-08 02:26:40 -08:00
parent ea720974f5
commit 138cd7fa11
4 changed files with 115 additions and 69 deletions

View file

@ -51,7 +51,7 @@ SDL_Surface *
SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
{
SDL_bool was_error;
long fp_offset = 0;
Sint64 fp_offset = 0;
int bmpPitch;
int i, pad;
SDL_Surface *surface;
@ -371,7 +371,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
int
SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst)
{
long fp_offset;
Sint64 fp_offset;
int i, pad;
SDL_Surface *surface;
Uint8 *bits;
@ -515,7 +515,7 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst)
}
/* Write the bitmap offset */
bfOffBits = SDL_RWtell(dst) - fp_offset;
bfOffBits = (Uint32)(SDL_RWtell(dst) - fp_offset);
if (SDL_RWseek(dst, fp_offset + 10, RW_SEEK_SET) < 0) {
SDL_Error(SDL_EFSEEK);
}
@ -542,7 +542,7 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst)
}
/* Write the BMP file size */
bfSize = SDL_RWtell(dst) - fp_offset;
bfSize = (Uint32)(SDL_RWtell(dst) - fp_offset);
if (SDL_RWseek(dst, fp_offset + 2, RW_SEEK_SET) < 0) {
SDL_Error(SDL_EFSEEK);
}