Fixed double-mouse event bug on Windows using OpenGL
authorSam Lantinga <slouken@lokigames.com>
Sun, 29 Apr 2001 23:00:03 +0000
changeset 13e30a8ce27c22
parent 12 34d956b20f75
child 14 c3e9d4a623c1
Fixed double-mouse event bug on Windows using OpenGL
docs.html
src/video/wincommon/SDL_lowvideo.h
src/video/wincommon/SDL_sysevents.c
src/video/wincommon/SDL_sysmouse.c
     1.1 --- a/docs.html	Sun Apr 29 22:59:47 2001 +0000
     1.2 +++ b/docs.html	Sun Apr 29 23:00:03 2001 +0000
     1.3 @@ -16,6 +16,7 @@
     1.4  Major changes since SDL 1.0.0:
     1.5  </H2>
     1.6  <UL>
     1.7 +	<LI> 1.2.1: Fixed double-mouse event bug on Windows using OpenGL
     1.8  	<LI> 1.2.1: Fixed 320x200 video mode on framebuffer console
     1.9  	<LI> 1.2.1: Improved robustness for the ELO touchpad (thanks Alex!)
    1.10  	<LI> 1.2.1: Added support for building under Cygwin on Windows
     2.1 --- a/src/video/wincommon/SDL_lowvideo.h	Sun Apr 29 22:59:47 2001 +0000
     2.2 +++ b/src/video/wincommon/SDL_lowvideo.h	Sun Apr 29 23:00:03 2001 +0000
     2.3 @@ -35,13 +35,19 @@
     2.4  /* Hidden "this" pointer for the video functions */
     2.5  #define _THIS	SDL_VideoDevice *this
     2.6  
     2.7 -#define DIRECTX_FULLSCREEN() 						\
     2.8 +#define DDRAW_FULLSCREEN() 						\
     2.9  (									\
    2.10  	((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
    2.11  	((SDL_VideoSurface->flags & SDL_OPENGL    ) != SDL_OPENGL    ) && \
    2.12  	(strcmp(this->name, "directx") == 0)				\
    2.13  )
    2.14  
    2.15 +#define DINPUT_FULLSCREEN() 						\
    2.16 +(									\
    2.17 +	((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
    2.18 +	(strcmp(this->name, "directx") == 0)				\
    2.19 +)
    2.20 +
    2.21  /* The main window -- and a function to set it for the audio */
    2.22  extern const char *SDL_Appname;
    2.23  extern HINSTANCE SDL_Instance;
     3.1 --- a/src/video/wincommon/SDL_sysevents.c	Sun Apr 29 22:59:47 2001 +0000
     3.2 +++ b/src/video/wincommon/SDL_sysevents.c	Sun Apr 29 23:00:03 2001 +0000
     3.3 @@ -200,7 +200,7 @@
     3.4  		case WM_MOUSEMOVE: {
     3.5  			
     3.6  			/* Mouse is handled by DirectInput when fullscreen */
     3.7 -			if ( SDL_VideoSurface && ! DIRECTX_FULLSCREEN() ) {
     3.8 +			if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
     3.9  				Sint16 x, y;
    3.10  
    3.11  				/* mouse has entered the window */
    3.12 @@ -243,7 +243,7 @@
    3.13  		case WM_MOUSELEAVE: {
    3.14  
    3.15  			/* Mouse is handled by DirectInput when fullscreen */
    3.16 -			if ( SDL_VideoSurface && ! DIRECTX_FULLSCREEN() ) {
    3.17 +			if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
    3.18  				/* mouse has left the window */
    3.19  				/* or */
    3.20  				/* Elvis has left the building! */
    3.21 @@ -261,7 +261,7 @@
    3.22  		case WM_RBUTTONDOWN:
    3.23  		case WM_RBUTTONUP: {
    3.24  			/* Mouse is handled by DirectInput when fullscreen */
    3.25 -			if ( SDL_VideoSurface && ! DIRECTX_FULLSCREEN() ) {
    3.26 +			if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
    3.27  				Sint16 x, y;
    3.28  				Uint8 button, state;
    3.29  
     4.1 --- a/src/video/wincommon/SDL_sysmouse.c	Sun Apr 29 22:59:47 2001 +0000
     4.2 +++ b/src/video/wincommon/SDL_sysmouse.c	Sun Apr 29 23:00:03 2001 +0000
     4.3 @@ -192,7 +192,7 @@
     4.4  	POINT mouse_pos;
     4.5  
     4.6  	/* The fullscreen cursor must be done in software with DirectInput */
     4.7 -	if ( !this->screen || DIRECTX_FULLSCREEN() ) {
     4.8 +	if ( !this->screen || DDRAW_FULLSCREEN() ) {
     4.9  		return(0);
    4.10  	}
    4.11  
    4.12 @@ -213,7 +213,7 @@
    4.13  {
    4.14  	POINT pt;
    4.15  
    4.16 -	if ( DIRECTX_FULLSCREEN() ) {
    4.17 +	if ( DDRAW_FULLSCREEN() ) {
    4.18  		x += (this->screen->offset % this->screen->pitch) /
    4.19  		      this->screen->format->BytesPerPixel;
    4.20  		y += (this->screen->offset / this->screen->pitch);
    4.21 @@ -237,7 +237,7 @@
    4.22  	RECT rect;
    4.23  	POINT pt;
    4.24  
    4.25 -	if ( ! DIRECTX_FULLSCREEN() ) {
    4.26 +	if ( ! DDRAW_FULLSCREEN() ) {
    4.27  		GetClientRect(SDL_Window, &rect);
    4.28  		GetCursorPos(&pt);
    4.29  		MapWindowPoints(NULL, SDL_Window, &pt, 1);