Example #1
0
/** Read the icon property from a client. */
void ReadNetWMIcon(ClientNode *np)
{
   unsigned long count;
   int status;
   unsigned long extra;
   Atom realType;
   int realFormat;
   unsigned char *data;
   status = JXGetWindowProperty(display, np->window, atoms[ATOM_NET_WM_ICON],
                                0, 256 * 256 * 4, False, XA_CARDINAL,
                                &realType, &realFormat, &count, &extra, &data);
   if(status == Success && realFormat != 0 && data) {
      np->icon = CreateIconFromBinary((unsigned long*)data, count);
      JXFree(data);
   }
}
Example #2
0
File: icon.c Project: Miteam/jwm
/** Read the icon property from a client. */
IconNode *ReadNetWMIcon(Window win)
{
   static const long MAX_LENGTH = 1 << 20;
   IconNode *icon = NULL;
   unsigned long count;
   int status;
   unsigned long extra;
   Atom realType;
   int realFormat;
   unsigned char *data;
   status = JXGetWindowProperty(display, win, atoms[ATOM_NET_WM_ICON],
                                0, MAX_LENGTH, False, XA_CARDINAL,
                                &realType, &realFormat, &count, &extra, &data);
   if(status == Success && realFormat != 0 && data) {
      icon = CreateIconFromBinary((unsigned long*)data, count);
      JXFree(data);
   }
   return icon;
}