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

int xdo_window_get_focus ( const xdo_t xdo,
Window *  window_ret 
)

Get the window currently having focus.

Parameters:
window_ret Pointer to a window where the currently-focused window will be stored.

Definition at line 942 of file xdo.c.

References xdo::xdpy.

                                                               {
  int ret = 0;
  int unused_revert_ret;

  ret = XGetInputFocus(xdo->xdpy, window_ret, &unused_revert_ret);

  /* Xvfb with no window manager and given otherwise no input, with 
   * a single client, will return the currenet focused window as '1'
   * I think this is a bug, so let's alert the user. */
  if (*window_ret == 1) {
    fprintf(stderr, 
            "XGetInputFocus returned the focused window of %ld. "
            "This is likely a bug in the X server.\n", *window_ret);
  }
  return _is_success("XGetInputFocus", ret == 0);
}


Generated by  Doxygen 1.6.0   Back to index