# Patch to fix mouse movement problem in win32/fullscreen opengl

**URL:** <https://discourse.libsdl.org/t/patch-to-fix-mouse-movement-problem-in-win32-fullscreen-opengl/5586>\
**Category:** SDL Development\
**Created:** [December 10, 2001, 10:56am UTC](https://discourse.libsdl.org/t/patch-to-fix-mouse-movement-problem-in-win32-fullscreen-opengl/5586 "2001-12-10T10:56:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mika\_Kolehmainen](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/c6cbf5/32.png) [@Mika\_Kolehmainen](https://discourse.libsdl.org/u/Mika_Kolehmainen)\
**Post date:** [December 10, 2001, 10:56am UTC](https://discourse.libsdl.org/t/patch-to-fix-mouse-movement-problem-in-win32-fullscreen-opengl/5586/1 "2001-12-10T10:56:03Z")

</div>

Hi,

There is something wrong with mouse cursor position in windows when using  
opengl in fullscreen mode; coordinates doesn’t seem to be what cursor  
shows so menus do not work properly etc. In windowed mode all is ok. This  
has been reported before too  
([http://www.libsdl.org/pipermail/sdl/2001-July/037195.html](http://www.libsdl.org/pipermail/sdl/2001-July/037195.html)).

Following patch should fix it but i’m not exactly sure if its the right  
way to do it so someone who knows these better, please take a look.

— src/video/wincommon/SDL\_sysevents.c~ Thu Sep 13 19:15:44 2001  
+++ src/video/wincommon/SDL\_sysevents.c Sat Dec 8 20:50:40 2001  
@@ -202,7 +202,7 @@  
case WM\_MOUSEMOVE: {

```
                    /* Mouse is handled by DirectInput when fullscreen 

```

\*/

- 

```
                  if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {

```

- 

```
                  if ( SDL_VideoSurface && ! DDRAW_FULLSCREEN() ) {
                          Sint16 x, y;

                          /* mouse has entered the window */

```

@@ -245,7 +245,7 @@  
case WM\_MOUSELEAVE: {

```
                    /* Mouse is handled by DirectInput when fullscreen 

```

\*/

- 

```
                  if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {

```

- 

```
                  if ( SDL_VideoSurface && ! DDRAW_FULLSCREEN() ) {
                          /* mouse has left the window */
                          /* or */
                          /* Elvis has left the building! */

```

PS. first post, and i’m not subscribed on list :)–  
Mika Kolehmainen \<@Mika\_Kolehmainen\> | gwl at IRCNet
