Skip to content

Instantly share code, notes, and snippets.

@woodruffw
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save woodruffw/c79844f97542a70f41f6 to your computer and use it in GitHub Desktop.

Select an option

Save woodruffw/c79844f97542a70f41f6 to your computer and use it in GitHub Desktop.
/* name_window
Name the given window "name" on the given display.
Arguments:
Display *disp - a pointer to the X display
Window wind - the window being named
const char *name - the name being given to the window
*/
void name_window(Display *disp, Window wind, const char *name)
{
XTextProperty name_prop;
name_prop.value = (unsigned char *) name;
name_prop.encoding = XA_STRING; /* found in X11/Xatom.h */
name_prop.format = 8; /* our format is 8 bits, ASCII encoded */
name_prop.nitems = strlen(name); /* specify the number of characters in name */
XSetWMName(disp, wind, &name_prop);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment