Gtk.Widget.prototype.set_double_buffered
function set_double_buffered(double_buffered:Boolean):void { // Gjs wrapper for gtk_widget_set_double_buffered() }
Widgets are double buffered by default; you can use this function to turn off the buffering. "Double buffered" simply means that Gdk.begin_paint_region and Gdk.end_paint are called automatically around expose events sent to the widget. Gdk.begin_paint_region diverts all drawing to a widget's window to an offscreen buffer, and Gdk.end_paint draws the buffer to the screen. The result is that users see the window update in one smooth step, and don't see individual graphics primitives being rendered.
In very simple terms, double buffered widgets don't flicker, so you would only use this function to turn off double buffering if you had special needs and really knew what you were doing.
Note: if you turn off double-buffering, you have to handle expose events, since even the clearing to the background color or pixmap will not happen automatically (as it is done in Gdk.begin_paint_region).
- double_buffered
true to double-buffer a widget