diff -r d09d4b578e77 src/video/x11/SDL_x11window.c --- a/src/video/x11/SDL_x11window.c Tue Jul 29 08:04:15 2014 -0700 +++ b/src/video/x11/SDL_x11window.c Tue Jul 29 16:57:20 2014 -0300 @@ -923,7 +923,8 @@ /* Blocking wait for "MapNotify" event. * We use X11_XIfEvent because pXWindowEvent takes a mask rather than a type, * and XCheckTypedWindowEvent doesn't block */ - X11_XIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow); + if(!(window->flags & SDL_WINDOW_FOREIGN)) + X11_XIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow); X11_XFlush(display); } } @@ -939,7 +940,8 @@ if (X11_IsWindowMapped(_this, window)) { X11_XWithdrawWindow(display, data->xwindow, displaydata->screen); /* Blocking wait for "UnmapNotify" event */ - X11_XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow); + if(!(window->flags & SDL_WINDOW_FOREIGN)) + X11_XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow); X11_XFlush(display); } }