We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2565

Summary: SDL_RenderSetLogicalSize stretches render with SDL_WINDOW_ALLOW_HIGHDPI when window is resized and moved
Product: SDL Reporter: Diego <diegoacevedo91>
Component: renderAssignee: Sam Lantinga <slouken>
Status: WAITING --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86_64   
OS: Mac OS X 10.8   

Description Diego 2014-05-30 17:27:15 UTC
When a window is created with SDL_WINDOW_ALLOW_HIGHDPI and SDL_RenderSetLogicalSize is set on the renderer, resizing the window changes the scale and letterboxing correctly,  but if the window is then dragged and moved, the letterbox disappears and the renderer is stretched to the window size.
The following test code produces the stretching for me.
Removing SDL_WINDOW_ALLOW_HIGHDPI from the window flags produces no stretching. 

////CODE
#include <stdio.h>
#include "SDL.h"

int main(int argc, char *argv[]) {
    
    if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
        printf("Could not initialize SDL\n");
        return 1;
    }
    
    SDL_Window *window = SDL_CreateWindow("Title", 100,100,100,100, SDL_WINDOW_SHOWN|SDL_WINDOW_RESIZABLE|SDL_WINDOW_ALLOW_HIGHDPI);
    SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0);
    SDL_RenderSetLogicalSize(renderer, 100,100);
    
    SDL_bool running = SDL_TRUE;
    while (running) {
        
        SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
        SDL_RenderClear(renderer);
        SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
        SDL_RenderFillRect(renderer, NULL);
        SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);
        SDL_RenderFillRect(renderer, &(SDL_Rect){0,0,50,50});
        SDL_RenderPresent(renderer);
        
        SDL_Event event;
        while (SDL_PollEvent(&event)) {
            if (event.type == SDL_QUIT) {
                running = SDL_FALSE;
                break;
            }
        }
        
        SDL_Delay(100);
    }
    
    return 0;
}
Comment 1 Sam Lantinga 2017-08-14 13:04:53 UTC
This should be fixed with the latest SDL snapshot, can you please confirm?
http://www.libsdl.org/tmp/SDL-2.0.zip
Comment 2 Diego 2017-08-21 13:23:53 UTC
No this is still not fixed with the latest commit.