synchronized public void writeSetDesktopSize(int width, int height,
                                  ScreenSet layout)
	{
	  if (!cp.supportsSetDesktopSize)
	    throw new ErrorException("Server does not support SetDesktopSize");

	  startMsg(MsgTypes.msgTypeSetDesktopSize);
	  os.pad(1);

	  os.writeU16(width);
	  os.writeU16(height);

	  os.writeU8(layout.numScreens());
	  os.pad(1);

    for (Iterator<Screen> iter = layout.screens.iterator(); iter.hasNext(); ) {
      Screen refScreen = (Screen)iter.next();
	    os.writeU32(refScreen.id);
	    os.writeU16(refScreen.dimensions.tl.x);
	    os.writeU16(refScreen.dimensions.tl.y);
	    os.writeU16(refScreen.dimensions.width());
	    os.writeU16(refScreen.dimensions.height());
	    os.writeU32(refScreen.flags);
	  }

	  endMsg();
	}