diff --git a/ChangeLog b/ChangeLog index 637a2c8..106fc28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-06-01 Wolfgang Lux + + * Headers/x11/XGServerWindow.h (GSMaxWMProtocols, _gswindow_device_t): + Enlarge protocol array to make space for the _NET_WM_SYNC_REQUEST + protocol atom. + + * Source/x11/XGServerWindow.m (_setSupportedWMProtocols:): Add + assertion to catch out of bounds errors in the future. + 2011-05-27 13:53 David Chisnall * libs/back/trunk/Source/x11/XGServerWindow.m: Call NSZoneFree() on diff --git a/Headers/x11/XGServerWindow.h b/Headers/x11/XGServerWindow.h index 7e6f004..0ce9efd 100644 --- a/Headers/x11/XGServerWindow.h +++ b/Headers/x11/XGServerWindow.h @@ -72,6 +72,8 @@ typedef struct { #define WMFHideOtherApplications 10 #define WMFHideApplication 12 +#define GSMaxWMProtocols 5 + /* Graphics Driver protocol. Setup in [NSGraphicsContext-contextDevice:] */ enum { GDriverHandlesBacking = 1, @@ -109,7 +111,7 @@ typedef struct _gswindow_device_t { int xoff; int yoff; int boff; - Atom protocols[4]; + Atom protocols[GSMaxWMProtocols]; int numProtocols; XIC ic; void *gdriver; /* gdriver ident. Managed by gdriver */ diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index 2e3eabf..eca8729 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -1456,6 +1456,9 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg) { window->protocols[window->numProtocols++] = generic.miniaturize_atom; } + NSAssert1(window->numProtocols <= GSMaxWMProtocols, + @"Too many protocols (%d > GSMaxWMProtocols)", + window->numProtocols); XSetWMProtocols(dpy, window->ident, window->protocols, window->numProtocols); }