- XGetWindowProperty(d, id, net_wm_icon, offset++, 1,
- False, XA_CARDINAL, &ret_type, &ret_format,
- &ret_items, &ret_bytesleft,
- (unsigned char**) &prop_return[image]);
- if (ret_type == None || ret_items < 1) {
- printf("No icon found\n");
- return 1;
- }
- w = prop_return[image][0];
- XFree(prop_return[image]);
-
- XGetWindowProperty(d, id, net_wm_icon, offset++, 1,
- False, XA_CARDINAL, &ret_type, &ret_format,
- &ret_items, &ret_bytesleft,
- (unsigned char**) &prop_return[image]);
- if (ret_type == None || ret_items < 1) {
- printf("Failed to get height\n");
- return 1;
- }
- h = prop_return[image][0];
- XFree(prop_return[image]);
-
- XGetWindowProperty(d, id, net_wm_icon, offset, w*h,
- False, XA_CARDINAL, &ret_type, &ret_format,
- &ret_items, &ret_bytesleft,
- (unsigned char**) &prop_return[image]);
- if (ret_type == None || ret_items < w*h) {
- printf("Failed to get image data\n");
- return 1;
- }
- offset += w*h;
-
- printf("Found icon with size %dx%d\n", w, h);
+ XGetWindowProperty(d, id, net_wm_icon, offset++, 1,
+ False, XA_CARDINAL, &ret_type, &ret_format,
+ &ret_items, &ret_bytesleft,
+ (unsigned char**) &prop_return[image]);
+ if (ret_type == None || ret_items < 1) {
+ printf("No icon found\n");
+ return 1;
+ }
+ w = prop_return[image][0];
+ XFree(prop_return[image]);
+
+ XGetWindowProperty(d, id, net_wm_icon, offset++, 1,
+ False, XA_CARDINAL, &ret_type, &ret_format,
+ &ret_items, &ret_bytesleft,
+ (unsigned char**) &prop_return[image]);
+ if (ret_type == None || ret_items < 1) {
+ printf("Failed to get height\n");
+ return 1;
+ }
+ h = prop_return[image][0];
+ XFree(prop_return[image]);
+
+ XGetWindowProperty(d, id, net_wm_icon, offset, w*h,
+ False, XA_CARDINAL, &ret_type, &ret_format,
+ &ret_items, &ret_bytesleft,
+ (unsigned char**) &prop_return[image]);
+ if (ret_type == None || ret_items < w*h) {
+ printf("Failed to get image data\n");
+ return 1;
+ }
+ offset += w*h;
+
+ printf("Found icon with size %dx%d\n", w, h);