[KMS/DRM] Revert unaproved fix for bug #5465.

This commit is contained in:
Manuel Alfayate Corchete 2021-01-19 15:35:43 +01:00
parent 6393d14de5
commit ee93f0edee

View File

@ -1079,11 +1079,6 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window)
int ret = 0; int ret = 0;
drmModeModeInfo *mode; drmModeModeInfo *mode;
/* Only 1 window is allowed: we can't flip on several windows in KMSDRM. */
if (viddata->num_windows > 0) {
return -1;
}
/* Allocate window internal data */ /* Allocate window internal data */
windata = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); windata = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData));
if (!windata) { if (!windata) {
@ -1190,18 +1185,23 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window)
windata->surface_w, windata->surface_h); windata->surface_w, windata->surface_h);
} /* NON-Vulkan block ends. */ } /* NON-Vulkan block ends. */
/* Add window to the internal list of tracked windows, which will
have 1 member only. */ /* Add window to the internal list of tracked windows. Note, while it may
viddata->windows = (SDL_Window **)SDL_calloc(1, sizeof(SDL_Window *)); seem odd to support multiple fullscreen windows, some apps create an
viddata->num_windows++; extra window as a dummy surface when working with multiple contexts */
viddata->max_windows = 1; if (viddata->num_windows >= viddata->max_windows) {
unsigned int new_max_windows = viddata->max_windows + 1;
viddata->windows = (SDL_Window **)SDL_realloc(viddata->windows,
new_max_windows * sizeof(SDL_Window *));
viddata->max_windows = new_max_windows;
if (!viddata->windows) { if (!viddata->windows) {
ret = SDL_OutOfMemory(); ret = SDL_OutOfMemory();
goto cleanup; goto cleanup;
} }
}
viddata->windows[0] = window; viddata->windows[viddata->num_windows++] = window;
/* If we have just created a Vulkan window, establish that we are in Vulkan mode now. */ /* If we have just created a Vulkan window, establish that we are in Vulkan mode now. */
viddata->vulkan_mode = is_vulkan; viddata->vulkan_mode = is_vulkan;