Re: What should be used?
- Date: Wed, 29 Jul 2015 13:05:22 +0100
- From: Emmanuele Bassi <ebassi@xxxxxxxxx>
- Subject: Re: What should be used?
On 29 July 2015 at 12:51, Igor Korot <ikorot01@xxxxxxxxx> wrote:
> Hi, ALL,
> The documentation says:
> gtk_widget_set_double_buffered has been deprecated since version 3.14
> and should not be used in newly-written code.
> This function does not work under non-X11 backends or with non-native
> windows. It should not be used in newly written code.
> However it does not say what should be used instead.
Nothing should be used instead.
All widgets inside GTK are double-buffered, and all windowing systems
are double buffering the drawing surfaces used to present things on
The only reason why somebody would remove double buffering is when
dealing with native surfaces directly, for instance when using OpenGL
on X11; this not only is generally broken, but also breaks the drawing
internals of GTK unless you constrain your requirements. Since GTK+
3.16, OpenGL is natively supported by GTK in a way that works with the
internal drawing model, so it's not necessary to use any other
external library or external code to use OpenGL — thus
gtk_widget_set_double_buffered() should not be used.
If you have legacy code that requires disabling double buffering, you
should probably invest some time into porting it to a proper solution
integrated with the GTK drawing model; in the meantime, you can still
call set_double_buffered() in your code. The API and its behaviour
won't go away until GTK+ 4.0.
[@] ebassi [@gmail.com]
gtk-list mailing list