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

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.
  • Loading branch information
slouken committed Nov 6, 2012
1 parent 93b1f11 commit ceff0a1adb6c6b3ac55ae2032129bcd0ff41ce96
Showing with 1 addition and 8 deletions.
  1. +1 −8 src/video/x11/SDL_x11events.c
@@ -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;
}

0 comments on commit ceff0a1

Please sign in to comment.