Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Only map/unmap if the window isn't already in the correct state.

  • Loading branch information
slouken committed Sep 28, 2012
1 parent 9d1a86b commit 77b81c14f9f6698c6fc4fc5de823a9183a81da71
Showing with 14 additions and 10 deletions.
  1. +14 −10 src/video/x11/SDL_x11window.c
@@ -809,12 +809,14 @@ X11_ShowWindow(_THIS, SDL_Window * window)
Display *display = data->videodata->display;
XEvent event;

XMapRaised(display, data->xwindow);
/* Blocking wait for "MapNotify" event.
* We use XIfEvent because XWindowEvent takes a mask rather than a type,
* and XCheckTypedWindowEvent doesn't block */
XIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow);
XFlush(display);
if (!X11_IsWindowMapped(_this, window)) {
XMapRaised(display, data->xwindow);
/* Blocking wait for "MapNotify" event.
* We use XIfEvent because XWindowEvent takes a mask rather than a type,
* and XCheckTypedWindowEvent doesn't block */
XIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow);
XFlush(display);
}
}

void
@@ -824,10 +826,12 @@ X11_HideWindow(_THIS, SDL_Window * window)
Display *display = data->videodata->display;
XEvent event;

XUnmapWindow(display, data->xwindow);
/* Blocking wait for "UnmapNotify" event */
XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow);
XFlush(display);
if (X11_IsWindowMapped(_this, window)) {
XUnmapWindow(display, data->xwindow);
/* Blocking wait for "UnmapNotify" event */
XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow);
XFlush(display);
}
}

void

0 comments on commit 77b81c1

Please sign in to comment.