Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
update window prev links
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 22, 2010
1 parent d6532c9 commit 6149a1b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/video/SDL_video.c
Expand Up @@ -903,6 +903,9 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
window->flags = (flags & allowed_flags);
window->display = display;
window->next = display->windows;
if (display->windows) {
display->windows->prev = window;
}
display->windows = window;

if (_this->CreateWindow && _this->CreateWindow(_this, window) < 0) {
Expand Down Expand Up @@ -943,6 +946,9 @@ SDL_CreateWindowFrom(const void *data)
window->flags = SDL_WINDOW_FOREIGN;
window->display = display;
window->next = display->windows;
if (display->windows) {
display->windows->prev = window;
}
display->windows = window;

if (!_this->CreateWindowFrom ||
Expand Down Expand Up @@ -1452,6 +1458,9 @@ SDL_DestroyWindow(SDL_Window * window)

/* Unlink the window from the list */
display = window->display;
if (window->next) {
window->next->prev = window->prev;
}
if (window->prev) {
window->prev->next = window->next;
} else {
Expand Down

0 comments on commit 6149a1b

Please sign in to comment.