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

int xdo_window_wait_for_active ( const xdo_t xdo,
Window  window,
int  active 
)

Wait for a window to be active or not active.

Requires your window manager to support this. Uses _NET_ACTIVE_WINDOW from the EWMH spec.

Parameters:
window the window to wait on
active If 1, wait for active. If 0, wait for inactive.

Definition at line 331 of file xdo.c.

                                                                            {
  Window activewin = 0;
  int ret = 0;

  /* If active is true, wait until activewin is our window
   * otherwise, wait until activewin is not our window */
  while (active ? activewin != window : activewin == window) {
    ret = xdo_window_get_active(xdo, &activewin);
    if (ret == XDO_ERROR) {
      return ret;
    }
    usleep(30000);
  }

  return 0;
}


Generated by  Doxygen 1.6.0   Back to index