Posts

Showing posts with the label x11

cairo / xlib not updating window content

Image
Clash Royale CLAN TAG #URR8PPP cairo / xlib not updating window content I am trying to learn how to use Cairo 2D drawing library with xlib surfaces. I wrote a little test program that allows creating multiple windows. Each function may have a custom paint() function that is called regularly to add some graphics content to the window, or redraw it completely if desired. There is also an option to define mouse and key listener. The main routine checks for X events (to delegate them to mouse and key listener) and for timeout for periodic call of those paint() functions. I tried with the 1.14.6 version of Cairo (that is currently available as package in Ubuntu 16.04), and the latest 1.15.12, but the results are the same. The expected behavior of this demo is to open 3 windows. One will have random rectangles being added, another one random texts, and the third random circles. In addition, clicking into windows should produce lines (connecting to mouse click, or randomly), and using arrow k...