xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Version 2 (modified by Antoine Martin, 8 years ago) (diff)


Client Porting Guide

The best way to port xpra to new language or toolkit is to look at the existing clients and use one of them as a template.


At the very least you will need:

  • a network layer capable of sending and receiving packets in the xpra protocol format. The network level packet is very simple: an 8 byte header which includes the packet size is followed by the packet data itself, the data is encoded using a bencoder-like format (the only notable difference is that unlike most other implementations, the dictionary keys are not in a specific order). Or optionally using rencode.
  • a window implementation representing a server-side window, usually supporting controls like minimize/maximize/close
  • creating new windows when new-window packets are received and destroying them when a lost-window is received
  • the ability to update the content of this window with RGB pixel data when receiving draw packets
  • the code should send a hello packet to the server and wait for the hello it sends back
  • you must respond to ping packets to prevent automatic disconnection


These are the things you will need to implement in order to be able to interact with your new client beyond just showing the windows:

  • providing a keymap to the server so keyboard input works
  • sending mouse events: mouse movements and clicks
  • sending window focus changes
  • window position changes, etc