@@ -871,6 +871,7 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
871
871
SDL_Surface * newownedsurf = NULL ;
872
872
int depth = 0 ;
873
873
int flags = 0 ;
874
+ int zero_size = 0 ;
874
875
int w , h , w_actual , h_actual ;
875
876
PyObject * size = NULL ;
876
877
int vsync = SDL_FALSE ;
@@ -988,6 +989,7 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
988
989
desktop resolution without breaking compatibility. */
989
990
w = display_mode .w ;
990
991
h = display_mode .h ;
992
+ zero_size = 1 ;
991
993
}
992
994
993
995
if (flags & PGS_FULLSCREEN ) {
@@ -1432,16 +1434,16 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
1432
1434
* be respected enough that we don't need to issue a warning
1433
1435
*/
1434
1436
if (!state -> using_gl && ((flags & (PGS_SCALED | PGS_FULLSCREEN )) == 0 ) &&
1435
- !vsync ) {
1437
+ !vsync && ((( flags & PGS_RESIZABLE ) == 0 ) || ! zero_size ) ) {
1436
1438
if (((surface -> surf -> w != w_actual ) ||
1437
1439
(surface -> surf -> h != h_actual )) &&
1438
1440
((surface -> surf -> flags & SDL_WINDOW_FULLSCREEN_DESKTOP ) != 0 )) {
1439
1441
char buffer [150 ];
1440
1442
char * format_string =
1441
- "Requested window size was smaller than minimum supported "
1442
- "window size on platform. Using (%d, %d) instead. " ;
1443
- snprintf (buffer , sizeof (buffer ), format_string , surface -> surf -> w ,
1444
- surface -> surf -> h );
1443
+ "Requested window was forcibly resized by the OS.\n\t "
1444
+ "Requested window size: (%d, %d)\n\tNew window size: (%d, %d)" ;
1445
+ snprintf (buffer , sizeof (buffer ), format_string , w_actual , h_actual ,
1446
+ surface -> surf -> w , surface -> surf -> h );
1445
1447
if (PyErr_WarnEx (PyExc_RuntimeWarning , buffer , 1 ) != 0 ) {
1446
1448
return NULL ;
1447
1449
}
0 commit comments