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

int xdo_set_desktop_for_window ( const xdo_t xdo,
Window  wid,
long  desktop 

Move a window to another desktop Uses _NET_WM_DESKTOP of the EWMH spec.

wid the window to move
desktop the desktop destination for the window

Definition at line 514 of file xdo.c.

References xdo::xdpy.

  XEvent xev;
  int ret = 0;
  XWindowAttributes wattr;
  XGetWindowAttributes(xdo->xdpy, wid, &wattr);

  if (_xdo_ewmh_is_supported(xdo, "_NET_WM_DESKTOP") == False) {
            "Your windowmanager claims not to support _NET_WM_DESKTOP, "
            "so the attempt to change a window's desktop location was "
    return XDO_ERROR;

  memset(&xev, 0, sizeof(xev));
  xev.type = ClientMessage;
  xev.xclient.display = xdo->xdpy;
  xev.xclient.window = wid;
  xev.xclient.message_type = XInternAtom(xdo->xdpy, "_NET_WM_DESKTOP", 
  xev.xclient.format = 32;
  xev.xclient.data.l[0] = desktop;
  xev.xclient.data.l[1] = 2; /* indicate we are messaging from a pager */

  ret = XSendEvent(xdo->xdpy, wattr.screen->root, False,
                   SubstructureNotifyMask | SubstructureRedirectMask,

  return _is_success("XSendEvent[EWMH:_NET_WM_DESKTOP]", ret == 0);

Generated by  Doxygen 1.6.0   Back to index