Simple Directmedia Layer
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

video: Don't overwrite pending size values when setting the window min/max

+8 -8
+8 -8
src/video/SDL_video.c
··· 3069 3069 3070 3070 bool SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h) 3071 3071 { 3072 - int w, h; 3073 - 3074 3072 CHECK_WINDOW_MAGIC(window, false); 3075 3073 if (min_w < 0) { 3076 3074 return SDL_InvalidParamError("min_w"); ··· 3092 3090 } 3093 3091 3094 3092 // Ensure that window is not smaller than minimal size 3095 - w = window->min_w ? SDL_max(window->floating.w, window->min_w) : window->floating.w; 3096 - h = window->min_h ? SDL_max(window->floating.h, window->min_h) : window->floating.h; 3093 + int w = window->last_size_pending ? window->pending.w : window->floating.w; 3094 + int h = window->last_size_pending ? window->pending.h : window->floating.h; 3095 + w = window->min_w ? SDL_max(w, window->min_w) : w; 3096 + h = window->min_h ? SDL_max(h, window->min_h) : h; 3097 3097 return SDL_SetWindowSize(window, w, h); 3098 3098 } 3099 3099 ··· 3111 3111 3112 3112 bool SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h) 3113 3113 { 3114 - int w, h; 3115 - 3116 3114 CHECK_WINDOW_MAGIC(window, false); 3117 3115 if (max_w < 0) { 3118 3116 return SDL_InvalidParamError("max_w"); ··· 3134 3132 } 3135 3133 3136 3134 // Ensure that window is not larger than maximal size 3137 - w = window->max_w ? SDL_min(window->floating.w, window->max_w) : window->floating.w; 3138 - h = window->max_h ? SDL_min(window->floating.h, window->max_h) : window->floating.h; 3135 + int w = window->last_size_pending ? window->pending.w : window->floating.w; 3136 + int h = window->last_size_pending ? window->pending.h : window->floating.h; 3137 + w = window->max_w ? SDL_min(w, window->max_w) : w; 3138 + h = window->max_h ? SDL_min(h, window->max_h) : h; 3139 3139 return SDL_SetWindowSize(window, w, h); 3140 3140 } 3141 3141