src/video/x11/SDL_x11window.c
changeset 6483 4b51ff3dcf74
parent 6481 fab4b15b17e9
child 6484 b904bb684095
     1.1 --- a/src/video/x11/SDL_x11window.c	Fri Sep 28 00:40:47 2012 -0700
     1.2 +++ b/src/video/x11/SDL_x11window.c	Fri Sep 28 00:57:47 2012 -0700
     1.3 @@ -809,12 +809,14 @@
     1.4      Display *display = data->videodata->display;
     1.5      XEvent event;
     1.6  
     1.7 -    XMapRaised(display, data->xwindow);
     1.8 -    /* Blocking wait for "MapNotify" event.
     1.9 -     * We use XIfEvent because XWindowEvent takes a mask rather than a type, 
    1.10 -     * and XCheckTypedWindowEvent doesn't block */
    1.11 -    XIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow);
    1.12 -    XFlush(display);
    1.13 +    if (!X11_IsWindowMapped(_this, window)) {
    1.14 +        XMapRaised(display, data->xwindow);
    1.15 +        /* Blocking wait for "MapNotify" event.
    1.16 +         * We use XIfEvent because XWindowEvent takes a mask rather than a type, 
    1.17 +         * and XCheckTypedWindowEvent doesn't block */
    1.18 +        XIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow);
    1.19 +        XFlush(display);
    1.20 +    }
    1.21  }
    1.22  
    1.23  void
    1.24 @@ -824,10 +826,12 @@
    1.25      Display *display = data->videodata->display;
    1.26      XEvent event;
    1.27  
    1.28 -    XUnmapWindow(display, data->xwindow);
    1.29 -    /* Blocking wait for "UnmapNotify" event */
    1.30 -    XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow);    
    1.31 -    XFlush(display);
    1.32 +    if (X11_IsWindowMapped(_this, window)) {
    1.33 +        XUnmapWindow(display, data->xwindow);
    1.34 +        /* Blocking wait for "UnmapNotify" event */
    1.35 +        XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow);    
    1.36 +        XFlush(display);
    1.37 +    }
    1.38  }
    1.39  
    1.40  void