MacOS: Added hint to control update of the metal layer's drawable size (#14053)

This commit is contained in:
Dima Volynets
2025-10-08 20:52:01 +03:00
committed by GitHub
parent 98eaa05a9f
commit e4f24ff7ae
2 changed files with 19 additions and 1 deletions

View File

@@ -90,7 +90,9 @@ static bool SDLCALL SDL_MetalViewEventWatch(void *userdata, SDL_Event *event)
self.layer.opaque = opaque;
SDL_AddWindowEventWatch(SDL_WINDOW_EVENT_WATCH_EARLY, SDL_MetalViewEventWatch, (__bridge void *)(self));
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_METAL_AUTO_RESIZE_DRAWABLE, true)) {
SDL_AddWindowEventWatch(SDL_WINDOW_EVENT_WATCH_EARLY, SDL_MetalViewEventWatch, (__bridge void *)(self));
}
[self updateDrawableSize];
}