Bladeren bron

Show the cursor when relative mode is enabled and the app doesn't have focus

Testing:
* Run test/testwm
* Hit Ctrl-R to toggle relative mode
* Alt-tab away
* Move the mouse over testwm
* Note that the cursor is visible until testwm gains focus
Sam Lantinga 10 maanden geleden
bovenliggende
commit
44f66b5c8b
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      src/events/SDL_mouse.c

+ 1 - 1
src/events/SDL_mouse.c

@@ -1541,7 +1541,7 @@ int SDL_SetCursor(SDL_Cursor *cursor)
         }
     }
 
-    if (cursor && mouse->cursor_shown && !mouse->relative_mode) {
+    if (cursor && (!mouse->focus || (mouse->cursor_shown && !mouse->relative_mode))) {
         if (mouse->ShowCursor) {
             mouse->ShowCursor(cursor);
         }