Skip to content

Commit

Permalink
Fix regression causing crashes when running without a window manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
Plagman committed Oct 23, 2013
1 parent 965a0da commit e077148
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/video/x11/SDL_x11events.c
Expand Up @@ -525,19 +525,22 @@ X11_DispatchEvent(_THIS)
long border_bottom = 0;
if (data->xwindow) {
Atom _net_frame_extents = X11_XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
Atom type;
Atom type = None;
int format;
unsigned long nitems, bytes_after;
unsigned long nitems = 0, bytes_after;
unsigned char *property;
X11_XGetWindowProperty(display, data->xwindow,
_net_frame_extents, 0, 16, 0,
XA_CARDINAL, &type, &format,
&nitems, &bytes_after, &property);

border_left = ((long*)property)[0];
border_right = ((long*)property)[1];
border_top = ((long*)property)[2];
border_bottom = ((long*)property)[3];
if (type != None && nitems == 4)
{
border_left = ((long*)property)[0];
border_right = ((long*)property)[1];
border_top = ((long*)property)[2];
border_bottom = ((long*)property)[3];
}
}

if (xevent.xconfigure.x != data->last_xconfigure.x ||
Expand Down

0 comments on commit e077148

Please sign in to comment.