Skip to content

Commit

Permalink
engine: platform: sdl: grab input only in true fullscreen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Oct 11, 2023
1 parent cb1063c commit 4acd0e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions engine/platform/sdl/vid_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,14 +757,15 @@ qboolean VID_CreateWindow( int width, int height, window_mode_t window_mode )
else
{
if( window_mode == WINDOW_MODE_FULLSCREEN )
SetBits( wndFlags, SDL_WINDOW_FULLSCREEN );
// need input grab only in true fullscreen mode
SetBits( wndFlags, SDL_WINDOW_FULLSCREEN | SDL_WINDOW_INPUT_GRABBED );
else
SetBits( wndFlags, SDL_WINDOW_FULLSCREEN_DESKTOP );
SetBits( wndFlags, SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_GRABBED );
SetBits( wndFlags, SDL_WINDOW_BORDERLESS );
xpos = ypos = 0;
}
#else
wndFlags |= SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_INPUT_GRABBED;
SetBits( wndFlags, SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_INPUT_GRABBED );
xpos = ypos = SDL_WINDOWPOS_UNDEFINED;
#endif

Expand Down

0 comments on commit 4acd0e5

Please sign in to comment.