Skip to content

Commit

Permalink
Updated to move mouse into center when turn off fullscreen.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlynxZhou committed Mar 5, 2020
1 parent cd49275 commit 9372a84
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions srcs/flipclock.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ void flipclock_set_fullscreen(struct flipclock *app, bool full)
SDL_SetWindowFullscreen(app->window, 0);
SDL_GetWindowSize(app->window, &app->properties.width,
&app->properties.height);
/* Move mouse back into center. */
SDL_WarpMouseInWindow(app->window, app->properties.width / 2,
app->properties.height / 2);
SDL_ShowCursor(SDL_ENABLE);
}
}
Expand Down

0 comments on commit 9372a84

Please sign in to comment.