Sfoglia il codice sorgente

SDL takes care of handling mouse relative mode on focus change

Sam Lantinga 1 anno fa
parent
commit
0cc61b27a2
1 ha cambiato i file con 0 aggiunte e 11 eliminazioni
  1. 0 11
      test/testwm.c

+ 0 - 11
test/testwm.c

@@ -187,17 +187,6 @@ static void loop(void)
                         SDL_GetDisplayName(SDL_GetDisplayForWindow(window)));
                         SDL_GetDisplayName(SDL_GetDisplayForWindow(window)));
             }
             }
         }
         }
-        if (event.type == SDL_EVENT_WINDOW_FOCUS_LOST) {
-            relative_mode = SDL_GetRelativeMouseMode();
-            if (relative_mode) {
-                SDL_SetRelativeMouseMode(SDL_FALSE);
-            }
-        }
-        if (event.type == SDL_EVENT_WINDOW_FOCUS_GAINED) {
-            if (relative_mode) {
-                SDL_SetRelativeMouseMode(SDL_TRUE);
-            }
-        }
         if (event.type == SDL_EVENT_KEY_UP) {
         if (event.type == SDL_EVENT_KEY_UP) {
             SDL_bool updateCursor = SDL_FALSE;
             SDL_bool updateCursor = SDL_FALSE;