removed winprop (merged into getproto) 352e1b4c
Anselm R. Garbe · 2006-08-22 17:38 1 file(s) · +7 −27
main.c +7 −27
62 62
		XFree(wins);
63 63
}
64 64
65 -
static int
66 -
winprop(Window w, Atom a, Atom t, long l, unsigned char **prop)
67 -
{
68 -
	int status, format;
69 -
	unsigned long res, extra;
70 -
	Atom real;
71 -
72 -
	status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format,
73 -
			&res, &extra, prop);
74 -
75 -
	if(status != Success || *prop == 0) {
76 -
		return 0;
77 -
	}
78 -
	if(res == 0) {
79 -
		free((void *) *prop);
80 -
	}
81 -
	return res;
82 -
}
83 -
84 65
/*
85 66
 * Startup Error handler to check if another window manager
86 67
 * is already running.
111 92
int
112 93
getproto(Window w)
113 94
{
114 -
	int protos = 0;
95 +
	int status, format, protos = 0;
115 96
	int i;
116 -
	long res;
117 -
	Atom *protocols;
97 +
	unsigned long extra, res;
98 +
	Atom *protocols, real;
118 99
119 -
	res = winprop(w, wmatom[WMProtocols], XA_ATOM, 20L,
120 -
			((unsigned char **)&protocols));
121 -
	if(res <= 0) {
100 +
	status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L,
101 +
			False, XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols);
102 +
	if(status != Success || protocols == 0)
122 103
		return protos;
123 -
	}
124 104
	for(i = 0; i < res; i++) {
125 105
		if(protocols[i] == wmatom[WMDelete])
126 106
			protos |= PROTODELWIN;
127 107
	}
128 -
	free((char *) protocols);
108 +
	free(protocols);
129 109
	return protos;
130 110
}
131 111