Set dimensions of fullscreen window (SDL 2)

How can i set the dimensions of a full screen display?
I am using this code. SDL switches to fullscreen. But screen resolution stays 1920 x 1080, that’s my desktop size - instead of 1024 x 768 as requested.

Code:

target.w = 1024;
target.h = 768;
target.format = 0; // don’t care
target.refresh_rate = 0; // don’t care
target.driverdata = 0; // initialize to 0

if (SDL_GetClosestDisplayMode(0, &target, &closest) != NULL) {

SDL_SetWindowFullscreen(this->SDLWin, SDL_WINDOW_FULLSCREEN);
SDL_SetWindowDisplayMode(this->SDLWin, &closest);

}

Never mind. Code works. It’s just the way my monitor displays 1024x768.