src/events/SDL_mouse.c
changeset 6300 82f95e6af4cd
parent 6138 4c64952a58fb
child 6301 e8a69c5378e7
equal deleted inserted replaced
6299:3809b2eee787 6300:82f95e6af4cd
   321     }
   321     }
   322 
   322 
   323     /* Set the relative mode */
   323     /* Set the relative mode */
   324     mouse->relative_mode = enabled;
   324     mouse->relative_mode = enabled;
   325 
   325 
   326     if (!enabled) {
   326     if (!enabled && mouse->focus) {
   327         /* Restore the expected mouse position */
   327         /* Restore the expected mouse position */
   328         SDL_WarpMouseInWindow(mouse->focus, mouse->x, mouse->y);
   328         SDL_WarpMouseInWindow(mouse->focus, mouse->x, mouse->y);
   329     }
   329     }
   330 
   330 
   331     /* Flush pending mouse motion */
   331     /* Flush pending mouse motion */