Re: GdbRgb flicker

On 21 Jan 2002, Havoc Pennington wrote:

> Jamie Guinan <guinan bluebutton com> writes: 
> > It looks like XMoveResizeWindow actually clears the window contents.
> > 
> > Of course, I would like it to leave the window contents as-is, and just 
> > redraw the RGB data over top of whatever was there.
> To leave the contents as-is one approach is to call
> gdk_window_set_back_pixmap (widget->window, NULL). This means clearing
> to background becomes a no-op. However this results in funky artifacts
> from time to time, because it also leaves the contents as-is when the
> window is exposed the first time while previously obscured, meaning
> the window looks "transparent" - so you really only want the NULL
> background during the resize...

Great, that seems to work well.  Note there's a 3rd argument
"gboolean parent_relative", so I used,

  gdk_window_set_back_pixmap (widget->window, NULL, FALSE);

I'll play around with only setting it during resize/configure/etc.

> What you really want probably is to set the bit gravity to
> NorthWestGravity instead of the 1.2 default (ForgetGravity).  This
> means that you avoid the clear-to-background entirely in the resize
> case, but clears to background in other cases (e.g. initial window
> map) still happen, and the background can still be a solid color
> instead of nothing.
> However to set the bit gravity you'll need to use Xlib.
> > Will Gtk2's non-flicker feature fix this?
> Yes. GTK 2 sets bit gravity to NorthWestGravity or StaticGravity, to
> avoid the clear on resize, and then it double buffers to avoid
> flicker.

Neat stuff.  I never knew about gravity before (maybe that's why I keep
bumping my head on the ceiling).  I'll have to read up on it (ah,
/usr/share/doc/XFree86-doc-4.1.0/X11/xlib.PS.gz , p.33).

Thanks again,

> Havoc

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