Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed XBadWindow error when iconified under Unity3D
Browse files Browse the repository at this point in the history
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 ceff0a1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/video/x11/SDL_x11events.c
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit ceff0a1

Please sign in to comment.