Logo Search packages:      
Sourcecode: xdotool version File versions  Download package

int xdo_window_setprop ( const xdo_t xdo,
Window  wid,
const char *  property,
const char *  value 
)

Change a window property.

Example properties you can change are WM_NAME, WM_ICON_NAME, etc.

Parameters:
wid The window to change a property of.
property the string name of the property.
value the string value of the property.

Definition at line 279 of file xdo.c.

References xdo::xdpy.

                                                                                               {
  
  char netwm_property[256] = "_NET_";
  int ret = 0;
  strncat(netwm_property, property, strlen(property));

  // Change the property
  ret = XChangeProperty(xdo->xdpy, wid, 
                        XInternAtom(xdo->xdpy, property, False), 
                        XInternAtom(xdo->xdpy, "STRING", False), 8, 
                        PropModeReplace, (unsigned char*)value, strlen(value));
  if (ret == 0) {
    return _is_success("XChangeProperty", ret == 0);
  }

  // Change _NET_<property> just in case for simpler NETWM compliance?
  ret = XChangeProperty(xdo->xdpy, wid, 
                        XInternAtom(xdo->xdpy, netwm_property, False), 
                        XInternAtom(xdo->xdpy, "STRING", False), 8, 
                        PropModeReplace, (unsigned char*)value, strlen(value));
  return _is_success("XChangeProperty", ret == 0);
}


Generated by  Doxygen 1.6.0   Back to index