src/video/SDL_video.c
changeset 3693 d3f330fc2009
parent 3692 ad85eb21a559
child 3694 b0a707f589a6
     1.1 --- a/src/video/SDL_video.c	Fri Jan 22 15:55:20 2010 +0000
     1.2 +++ b/src/video/SDL_video.c	Fri Jan 22 16:17:11 2010 +0000
     1.3 @@ -903,6 +903,9 @@
     1.4      window->flags = (flags & allowed_flags);
     1.5      window->display = display;
     1.6      window->next = display->windows;
     1.7 +    if (display->windows) {
     1.8 +        display->windows->prev = window;
     1.9 +    }
    1.10      display->windows = window;
    1.11  
    1.12      if (_this->CreateWindow && _this->CreateWindow(_this, window) < 0) {
    1.13 @@ -943,6 +946,9 @@
    1.14      window->flags = SDL_WINDOW_FOREIGN;
    1.15      window->display = display;
    1.16      window->next = display->windows;
    1.17 +    if (display->windows) {
    1.18 +        display->windows->prev = window;
    1.19 +    }
    1.20      display->windows = window;
    1.21  
    1.22      if (!_this->CreateWindowFrom ||
    1.23 @@ -1452,6 +1458,9 @@
    1.24  
    1.25      /* Unlink the window from the list */
    1.26      display = window->display;
    1.27 +    if (window->next) {
    1.28 +        window->next->prev = window->prev;
    1.29 +    }
    1.30      if (window->prev) {
    1.31          window->prev->next = window->next;
    1.32      } else {