Enlarge protocol array to make space for the _NET_WM_SYNC_REQUEST

protocol atom.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@33224 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2011-06-01 20:56:27 +00:00
parent c5c7bf600a
commit f8dda0994b
3 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,12 @@
2011-06-01 Wolfgang Lux <wolfgang.lux@gmail.com>
* 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 <theraven@gna.org>
* libs/back/trunk/Source/x11/XGServerWindow.m: Call NSZoneFree() on

View file

@ -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 */

View file

@ -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);
}