Commit 191149b
committed
Fix infinite vid_restart loop from SDL resize events on macOS
On macOS, the SDL2 Cocoa backend fires SDL_WINDOWEVENT_RESIZED during
fullscreen window creation as the window goes through a size negotiation
with the window server. Since vid_restart destroys and recreates the SDL
window, each restart triggers a resize event with the same dimensions,
which sets vidRestartTime, which fires another vid_restart one second
later, creating an infinite loop.
This does not occur on Linux or Windows where the X11/Win32 backends do
not emit resize events during fullscreen window creation.
Skip the vidRestartTime when the reported dimensions match what
r_customwidth and r_customheight already hold.1 parent e8f5ed1 commit 191149b
1 file changed
Lines changed: 20 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
1188 | | - | |
1189 | | - | |
1190 | | - | |
1191 | | - | |
1192 | | - | |
1193 | | - | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
1199 | 1208 | | |
1200 | 1209 | | |
1201 | 1210 | | |
| |||
0 commit comments