Re: Flickering with Socket and Plug



> But you seems to do the drawing completely wrong.
>
> Generally gtk_widget_queue_draw() is involved in the drawing process,
> that is that your timer does not do the drawing directly, but only
> invalidates the widget, which cause a indirect draw.

True, you are right. I had a look at a bunch of examples and many do it like this. They invalidate parts or the whole widget in a timer callback and redraw it in the on_draw function.

> You may find a few examples for this, one recent using plain C was
> contained in this thread:
>
> https://lists.cairographics.org/archives/cairo/2016-October/027791.html
>
> https://pastebin.com/in17XGjs

I just had a look at the links. In the example it is done almost the same like I do (if I got it right), though it must not be the "right way". But even placing gtk_widget_queue_draw into my draw_callback funtion does not prevent the window from flickering.

It must be someting inside the Socket and Plug of GTK, because when I simply add the drawing_area to the window (without any socket or plug involved) everything works fine.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]