Fixed XBadWindow error when iconified under Unity3D

Apparently the root window changes in this case.  We want to send to the root window that is being listened to by the window manager, so this should be okay.
This commit is contained in:
Sam Lantinga 2012-11-06 10:34:47 -08:00
parent b7b4b8b28a
commit 2e37ac8682

View File

@ -389,17 +389,11 @@ X11_DispatchEvent(_THIS)
if ((xevent.xclient.message_type == videodata->WM_PROTOCOLS) &&
(xevent.xclient.format == 32) &&
(xevent.xclient.data.l[0] == videodata->_NET_WM_PING)) {
SDL_DisplayData *dpydata;
Window root;
Window root = DefaultRootWindow(display);
#ifdef DEBUG_XEVENTS
printf("window %p: _NET_WM_PING\n", data);
#endif
dpydata = (SDL_DisplayData *)
SDL_GetDisplayForWindow(data->window);
root = RootWindow(display, dpydata->screen);
xevent.xclient.window = root;
XSendEvent(display, root, False, SubstructureRedirectMask | SubstructureNotifyMask, &xevent);
break;
@ -412,7 +406,6 @@ X11_DispatchEvent(_THIS)
#ifdef DEBUG_XEVENTS
printf("window %p: WM_DELETE_WINDOW\n", data);
#endif
SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0);
break;
}