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

int xdo_window_translate_with_sizehint ( const xdo_t xdo,
Window  window,
int  width,
int  height,
int *  width_ret,
int *  height_ret 
)

Apply a window's sizing hints (if any) to a given width and height.

This function wraps XGetWMNormalHints() and applies any resize increment and base size to your given width and height values.

Parameters:
window the window to use
width the unit width you want to translate
height the unit height you want to translate
width_ret the return location of the translated width
height_ret the return locatino of the translated height

Definition at line 212 of file xdo.c.

References xdo::xdpy.

                                                        {
  XSizeHints hints;
  long supplied_return;
  XGetWMNormalHints(xdo->xdpy, window, &hints, &supplied_return);
  if (supplied_return & PResizeInc) {
    width *= hints.width_inc;
    height *= hints.height_inc;
  } else {
    fprintf(stderr, "No size hints found for window %ld\n", window);
    *width_ret = width;
    *height_ret = width;
  }

  if (supplied_return & PBaseSize) {
    width += hints.base_width;
    height += hints.base_height;
  }

  *width_ret = width;
  *height_ret = height;

  return XDO_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index