diff options
author | Sam Lantinga <slouken@libsdl.org> | 2010-01-22 16:17:11 +0000 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2010-01-22 16:17:11 +0000 |
commit | 0bea959d899c2230d10437db10526ea301716007 (patch) | |
tree | 36e5fa6b799211185e273f210ace0e588dbccf90 | |
parent | b4f5a3c8b7d278a11ee31519c70031901e2a37fc (diff) |
update window prev links
-rw-r--r-- | src/video/SDL_video.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 96af1e21f1..7f9bf1abe5 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -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) { @@ -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 || @@ -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 { |