I have been coding up the examples for Cairo and have found that things draw ok for the most part. When I cover my window with another window and then reexpose my cairo graphics window, the window doesn't redraw. I get whatever the prior window contributed to the background. I also notice in another application I am running that I get only the background fill (desktop image) on creation and nothing ever displays in the window. I am using Gtk 3.4.1.
Cairo let's you draw to surface. That's it. It has nothing to do with automatic redraw when needed. This is why normally Gtk uses double buffering. It let's you draw to an off-screen surface and then copies that to the screen whenever needed. You still have to implement the "draw" signal on your widgets to redraw when then needed (e.g. window was resized and thus your widget now has more/less space available). So alltogether, your code has to handle redrawing, because only your code can do so. There is no bug here, neither in Gtk nor in Cairo. (I don't know why the double buffering does not work in your case, but I guess you somehow disabled that. I have never really used Gtk and thus cannot say for sure and certainly not without looking at your code.)
I am still having issues of drawing with my second application and I am diagnosing the software currently. I see I get the configure event but nothing after that. The canned example works right now and you are right I had to redraw it but I had to catch the WM_PAINT event (since I am using Windows) by using gdk_window_add_filter and then pushing an expose event to the event queue. I don't use Gtk so I am guessing the makers decided to not send out the expose event which my application used back in the 2.x days. I am coding in Ada so it may be a bit foreign to you to look at. Chris.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.