How to detect (subscribe to) messages that causes screen repaint

Adam Jackson ajax at redhat.com
Thu Jul 5 19:18:39 UTC 2018


On Thu, 2018-07-05 at 20:06 +0200, Nikola Radovanovic wrote:
> Hello,
> Can someone please point me to some documentation/samples on how to
> do the following:
> 
> I have to detect events (messages) that are issued when any of
> attached screens (one or possibly more of them) will be repainted
> (partially or completely). So any key press, new window, resize
> window, mouse move etc.

For updated window content, you want the Damage extension's events. X
doesn't have globally-available events for mouse motion though, sorry.

> What I am trying is to write a simple VNC viewer (server) for
> Linux/Android and I have not yet managed to figure out how to
> subscribe to such events in order to get 'paint' message and affected
> rectangular area.

I mean, tigervnc already exists, but sure, write another one, why not.
Do consider reading it though, unix/x0vncserver/*.cxx is pretty much
what you're describing, including examples of how to register for and
parse Damage events.

- ajax


More information about the xorg mailing list