Make gdk_window_process_[all]_updates() respect update_freeze_counter

2004-08-26  Matthias Clasen  <mclasen@redhat.com>

	Make gdk_window_process_[all]_updates() respect
	update_freeze_counter  (#144272, Soeren Sandmann)

	* gdk/gdkwindow.c (gdk_window_schedule_update): New function to
	install an idle for gdk_window_update_idle() if one isn't there
	already.
	(gdk_window_process_all_updates):
	(gdk_window_process_updates): Only process the updates if the
	window isn't frozen.
	(gdk_window_invalidate_maybe_recurse): Schedule an update when
	necessary.
	(gdk_window_thaw_updates): Use gdk_window_schedule_update() instead
	of directly installing the idle.
This commit is contained in:
Matthias Clasen 2004-08-26 14:09:08 +00:00 committed by Matthias Clasen
parent cd50f460a5
commit c429b89d56
5 changed files with 98 additions and 20 deletions

View File

@ -1,3 +1,19 @@
2004-08-26 Matthias Clasen <mclasen@redhat.com>
Make gdk_window_process_[all]_updates() respect
update_freeze_counter (#144272, Soeren Sandmann)
* gdk/gdkwindow.c (gdk_window_schedule_update): New function to
install an idle for gdk_window_update_idle() if one isn't there
already.
(gdk_window_process_all_updates):
(gdk_window_process_updates): Only process the updates if the
window isn't frozen.
(gdk_window_invalidate_maybe_recurse): Schedule an update when
necessary.
(gdk_window_thaw_updates): Use gdk_window_schedule_update() instead
of directly installing the idle.
2004-08-22 Robert Ögren <gtk@roboros.com>
On Win32, make graphical tablets work on multi-monitor systems.

View File

@ -1,3 +1,19 @@
2004-08-26 Matthias Clasen <mclasen@redhat.com>
Make gdk_window_process_[all]_updates() respect
update_freeze_counter (#144272, Soeren Sandmann)
* gdk/gdkwindow.c (gdk_window_schedule_update): New function to
install an idle for gdk_window_update_idle() if one isn't there
already.
(gdk_window_process_all_updates):
(gdk_window_process_updates): Only process the updates if the
window isn't frozen.
(gdk_window_invalidate_maybe_recurse): Schedule an update when
necessary.
(gdk_window_thaw_updates): Use gdk_window_schedule_update() instead
of directly installing the idle.
2004-08-22 Robert Ögren <gtk@roboros.com>
On Win32, make graphical tablets work on multi-monitor systems.

View File

@ -1,3 +1,19 @@
2004-08-26 Matthias Clasen <mclasen@redhat.com>
Make gdk_window_process_[all]_updates() respect
update_freeze_counter (#144272, Soeren Sandmann)
* gdk/gdkwindow.c (gdk_window_schedule_update): New function to
install an idle for gdk_window_update_idle() if one isn't there
already.
(gdk_window_process_all_updates):
(gdk_window_process_updates): Only process the updates if the
window isn't frozen.
(gdk_window_invalidate_maybe_recurse): Schedule an update when
necessary.
(gdk_window_thaw_updates): Use gdk_window_schedule_update() instead
of directly installing the idle.
2004-08-22 Robert Ögren <gtk@roboros.com>
On Win32, make graphical tablets work on multi-monitor systems.

View File

@ -1,3 +1,19 @@
2004-08-26 Matthias Clasen <mclasen@redhat.com>
Make gdk_window_process_[all]_updates() respect
update_freeze_counter (#144272, Soeren Sandmann)
* gdk/gdkwindow.c (gdk_window_schedule_update): New function to
install an idle for gdk_window_update_idle() if one isn't there
already.
(gdk_window_process_all_updates):
(gdk_window_process_updates): Only process the updates if the
window isn't frozen.
(gdk_window_invalidate_maybe_recurse): Schedule an update when
necessary.
(gdk_window_thaw_updates): Use gdk_window_schedule_update() instead
of directly installing the idle.
2004-08-22 Robert Ögren <gtk@roboros.com>
On Win32, make graphical tablets work on multi-monitor systems.

View File

@ -1987,11 +1987,33 @@ gdk_window_copy_to_image (GdkDrawable *drawable,
/* Code for dirty-region queueing
*/
static GSList *update_windows = NULL;
static guint update_idle = 0;
static gboolean debug_updates = FALSE;
static gboolean
gdk_window_update_idle (gpointer data)
{
GDK_THREADS_ENTER ();
gdk_window_process_all_updates ();
GDK_THREADS_LEAVE ();
return FALSE;
}
static void
gdk_window_schedule_update (GdkWindow *window)
{
if (window && GDK_WINDOW_OBJECT (window)->update_freeze_count)
return;
if (!update_idle)
{
update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW,
gdk_window_update_idle, NULL, NULL);
}
}
static void
gdk_window_process_updates_internal (GdkWindow *window)
{
@ -2111,7 +2133,13 @@ gdk_window_process_all_updates (void)
while (tmp_list)
{
gdk_window_process_updates_internal (tmp_list->data);
GdkWindowObject *private = (GdkWindowObject *)tmp_list->data;
if (private->update_freeze_count)
update_windows = g_slist_prepend (update_windows, private);
else
gdk_window_process_updates_internal (tmp_list->data);
g_object_unref (tmp_list->data);
tmp_list = tmp_list->next;
}
@ -2121,16 +2149,6 @@ gdk_window_process_all_updates (void)
flush_all_displays ();
}
static gboolean
gdk_window_update_idle (gpointer data)
{
GDK_THREADS_ENTER ();
gdk_window_process_all_updates ();
GDK_THREADS_LEAVE ();
return FALSE;
}
/**
* gdk_window_process_updates:
* @window: a #GdkWindow
@ -2155,7 +2173,7 @@ gdk_window_process_updates (GdkWindow *window,
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
if (private->update_area)
if (private->update_area && !private->update_freeze_count)
{
gdk_window_process_updates_internal (window);
update_windows = g_slist_remove (update_windows, window);
@ -2300,9 +2318,7 @@ gdk_window_invalidate_maybe_recurse (GdkWindow *window,
update_windows = g_slist_prepend (update_windows, window);
private->update_area = gdk_region_copy (visible_region);
if (!private->update_freeze_count && !update_idle)
update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW,
gdk_window_update_idle, NULL, NULL);
gdk_window_schedule_update (window);
}
if (child_func)
@ -2474,10 +2490,8 @@ gdk_window_thaw_updates (GdkWindow *window)
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (private->update_freeze_count > 0);
private->update_freeze_count--;
if (!private->update_freeze_count && private->update_area && !update_idle)
update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW,
gdk_window_update_idle, NULL, NULL);
if (--private->update_freeze_count == 0)
gdk_window_schedule_update (window);
}
/**