Skip to content

Commit 86271de

Browse files
committed
Don't warn with zero size with RESIZABLE
1 parent 56bad98 commit 86271de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src_c/display.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
871871
SDL_Surface *newownedsurf = NULL;
872872
int depth = 0;
873873
int flags = 0;
874+
int zero_size = 0;
874875
int w, h, w_actual, h_actual;
875876
PyObject *size = NULL;
876877
int vsync = SDL_FALSE;
@@ -988,8 +989,7 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
988989
desktop resolution without breaking compatibility. */
989990
w = display_mode.w;
990991
h = display_mode.h;
991-
w_actual = w; /* avoid warning false positives */
992-
h_actual = h;
992+
zero_size = 1;
993993
}
994994

995995
if (flags & PGS_FULLSCREEN) {
@@ -1434,7 +1434,7 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
14341434
* be respected enough that we don't need to issue a warning
14351435
*/
14361436
if (!state->using_gl && ((flags & (PGS_SCALED | PGS_FULLSCREEN)) == 0) &&
1437-
!vsync) {
1437+
!vsync && (((flags & PGS_RESIZABLE) == 0) || !zero_size)) {
14381438
if (((surface->surf->w != w_actual) ||
14391439
(surface->surf->h != h_actual)) &&
14401440
((surface->surf->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0)) {

0 commit comments

Comments
 (0)