[gtk+] Make gdk_window_flush public
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Make gdk_window_flush public
- Date: Mon, 14 Sep 2009 14:11:18 +0000 (UTC)
commit cfeba9c3897a6b0ca8a50703f2336520204b4ac8
Author: Alexander Larsson <alexl redhat com>
Date: Mon Sep 14 16:07:25 2009 +0200
Make gdk_window_flush public
We need to call this from Gtk+, and its concievable that some other
app doing weird stuff could have a use for it.
gdk/gdk.symbols | 1 +
gdk/gdkwindow.c | 25 +++++++++++++++++++++++--
gdk/gdkwindow.h | 1 +
3 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 8ea2eea..6e25f87 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -687,6 +687,7 @@ gdk_window_clear_area_e
gdk_window_constrain_size
gdk_window_destroy
gdk_window_end_paint
+gdk_window_flush
gdk_window_foreign_new
gdk_window_freeze_toplevel_updates_libgtk_only
gdk_window_freeze_updates
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index ba60fa5..4194993 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -322,7 +322,6 @@ static void recompute_visible_regions (GdkWindowObject *private,
gboolean recalculate_siblings,
gboolean recalculate_children);
static void gdk_window_flush_outstanding_moves (GdkWindow *window);
-static void gdk_window_flush (GdkWindow *window);
static void gdk_window_flush_recursive (GdkWindowObject *window);
static void do_move_region_bits_on_impl (GdkWindowObject *private,
GdkRegion *region, /* In impl window coords */
@@ -3229,7 +3228,29 @@ gdk_window_flush_outstanding_moves (GdkWindow *window)
impl_window->outstanding_moves = NULL;
}
-static void
+/**
+ * gdk_window_flush:
+ * @window: a #GdkWindow
+ *
+ * Flush all outstanding cached operations on a window, leaving the
+ * window in a state which reflects all that has been drawn before.
+ *
+ * Gdk uses multiple kinds of caching to get better performance and
+ * nicer drawing. For instance, during exposes all paints to a window
+ * using double buffered rendering are keep on a pixmap until the last
+ * window has been exposed. It also delays window moves/scrolls until
+ * as long as possible until next update to avoid tearing when moving
+ * windows.
+ *
+ * Normally this should be completely invisible to applications, as
+ * we automatically flush the windows when required, but this might
+ * be needed if you for instance mix direct native drawing with
+ * gdk drawing. For Gtk widgets that don't use double buffering this
+ * will be called automatically before sending the expose event.
+ *
+ * Since: 2.18
+ **/
+void
gdk_window_flush (GdkWindow *window)
{
gdk_window_flush_outstanding_moves (window);
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 3370e0f..b850275 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -509,6 +509,7 @@ void gdk_window_begin_paint_rect (GdkWindow *window,
void gdk_window_begin_paint_region (GdkWindow *window,
const GdkRegion *region);
void gdk_window_end_paint (GdkWindow *window);
+void gdk_window_flush (GdkWindow *window);
void gdk_window_set_title (GdkWindow *window,
const gchar *title);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]