Commit c8d89a96 authored by Richard Hult's avatar Richard Hult Committed by Richard Hult
Browse files

Refactor the process updates functions to share code between them. Also

2007-04-18  Richard Hult  <richard@imendio.com>

	* gdk/quartz/gdkwindow-quartz.c:
	(gdk_window_quartz_process_updates_internal),
	(gdk_window_quartz_process_all_updates),
	(gdk_window_impl_quartz_process_updates): Refactor the process 
	updates functions to share code between them. Also fixes bug 
	#427660 by not updating larger regions than necessary.

svn path=/trunk/; revision=17610
parent d558d49c
2007-04-18 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkwindow-quartz.c:
(gdk_window_quartz_process_updates_internal),
(gdk_window_quartz_process_all_updates),
(gdk_window_impl_quartz_process_updates): Refactor the process
updates functions to share code between them. Also fixes bug
#427660 by not updating larger regions than necessary.
2007-04-18 Matthias Clasen <mclasen@redhat.com> 2007-04-18 Matthias Clasen <mclasen@redhat.com>
* gdk/gdkregion-generic.h (GROWREGION): Handle the case * gdk/gdkregion-generic.h (GROWREGION): Handle the case
......
...@@ -253,27 +253,16 @@ gdk_window_impl_quartz_end_paint (GdkPaintable *paintable) ...@@ -253,27 +253,16 @@ gdk_window_impl_quartz_end_paint (GdkPaintable *paintable)
} }
static void static void
gdk_window_quartz_process_all_updates (void) gdk_window_quartz_process_updates_internal (GdkWindow *window)
{ {
GSList *old_update_windows = update_windows; GdkWindowObject *private = (GdkWindowObject *) window;
GSList *tmp_list = update_windows; GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *) private->impl;
update_idle = 0;
update_windows = NULL;
g_slist_foreach (old_update_windows, (GFunc) g_object_ref, NULL);
GDK_QUARTZ_ALLOC_POOL;
while (tmp_list) if (private->update_area)
{ {
GdkWindowObject *private = tmp_list->data;
GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *) private->impl;
int i, n_rects; int i, n_rects;
GdkRectangle *rects; GdkRectangle *rects;
if (private->update_area)
{
gdk_region_get_rectangles (private->update_area, &rects, &n_rects); gdk_region_get_rectangles (private->update_area, &rects, &n_rects);
gdk_region_destroy (private->update_area); gdk_region_destroy (private->update_area);
...@@ -289,6 +278,24 @@ gdk_window_quartz_process_all_updates (void) ...@@ -289,6 +278,24 @@ gdk_window_quartz_process_all_updates (void)
g_free (rects); g_free (rects);
} }
}
static void
gdk_window_quartz_process_all_updates (void)
{
GSList *old_update_windows = update_windows;
GSList *tmp_list = update_windows;
update_idle = 0;
update_windows = NULL;
g_slist_foreach (old_update_windows, (GFunc) g_object_ref, NULL);
GDK_QUARTZ_ALLOC_POOL;
while (tmp_list)
{
gdk_window_quartz_process_updates_internal (tmp_list->data);
g_object_unref (tmp_list->data); g_object_unref (tmp_list->data);
tmp_list = tmp_list->next; tmp_list = tmp_list->next;
...@@ -350,12 +357,9 @@ gdk_window_impl_quartz_process_updates (GdkPaintable *paintable, ...@@ -350,12 +357,9 @@ gdk_window_impl_quartz_process_updates (GdkPaintable *paintable,
if (private->update_area) if (private->update_area)
{ {
gdk_region_destroy (private->update_area); gdk_window_quartz_process_updates_internal ((GdkWindow *) private);
private->update_area = NULL;
}
[impl->view setNeedsDisplay: YES];
update_windows = g_slist_remove (update_windows, private); update_windows = g_slist_remove (update_windows, private);
}
} }
static void static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment