Re: Problems with expose_event->region patch
- From: Owen Taylor <otaylor redhat com>
- To: gtk-devel-list gnome org
- Subject: Re: Problems with expose_event->region patch
- Date: 08 Mar 2001 12:38:33 -0500
srlytle_list yahoo com writes:
> > Hmm looking at that reminds me, we were going to remove
> > gdk_window_get_update_area() once the expose event included the
> > region, I think.
>
> this is kind of tangential, gdk_window_get_update_area sounded like
> what i wanted. i checked the source and its not, so i'll ask.
>
> i would like to be able to figure out what hunk of the a GdkWindow
> is actually visible to the user ie not obscured by another
> window or hidden by the pager, ie to figure out which pixels of
> a window actually correspond to physical screen pixels.
>
> is there such a function? it would be useful for animations so as
> to avoid using cpu updating a window that the user cannot
> appreciate.
There is an inherent race condition there - what if a window
on top is moved between the time you make the call and the
time you draw?
gdk_drawable_get_visible_region() returns a conservative estimate
that takes into account some of the clipping that GTK+ knows
about:
/**
* gdk_drawable_get_visible_region:
* @drawable:
*
* Computes the region of a drawable that is potentially visible.
* This does not necessarily take into account if the window is
* obscured by other windows, but no area outside of this region
* is visible.
*
* Return value: a #GdkRegion. This must be freed with gdk_region_destroy()
* when you are done.
**/
This is mostly interesting for something like a viewport where only a
portion of a large window is visible.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]