xpra icon
Bug tracker and wiki

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.

Basics

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

Interactive

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
Last modified 3 years ago Last modified on 01/24/14 12:05:25