GdkWindow: Use GPeriodic to repaint windows
Replace the invalidation idle function with a damage registration inside GPeriodic, using the GDK thread functions.
This commit is contained in:
@@ -3760,7 +3760,7 @@ gdk_window_set_cairo_clip (GdkDrawable *drawable,
|
||||
/* Code for dirty-region queueing
|
||||
*/
|
||||
static GSList *update_windows = NULL;
|
||||
static guint update_idle = 0;
|
||||
static gboolean damage_reported;
|
||||
static gboolean debug_updates = FALSE;
|
||||
|
||||
static inline gboolean
|
||||
@@ -3859,12 +3859,12 @@ gdk_window_remove_update_window (GdkWindow *window)
|
||||
update_windows = g_slist_remove (update_windows, window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_window_update_idle (gpointer data)
|
||||
static void
|
||||
gdk_window_repair (GPeriodic *periodic,
|
||||
gpointer user_data)
|
||||
{
|
||||
gdk_window_process_all_updates ();
|
||||
|
||||
return FALSE;
|
||||
damage_reported = FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -3885,11 +3885,11 @@ gdk_window_schedule_update (GdkWindow *window)
|
||||
gdk_window_is_toplevel_frozen (window)))
|
||||
return;
|
||||
|
||||
if (!update_idle)
|
||||
update_idle =
|
||||
gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
|
||||
gdk_window_update_idle,
|
||||
NULL, NULL);
|
||||
if (!damage_reported)
|
||||
{
|
||||
gdk_threads_periodic_damaged (gdk_window_repair, NULL, NULL);
|
||||
damage_reported = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -4212,18 +4212,15 @@ gdk_window_process_all_updates (void)
|
||||
/* We can't do this now since that would recurse, so
|
||||
delay it until after the recursion is done. */
|
||||
got_recursive_update = TRUE;
|
||||
update_idle = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
in_process_all_updates = TRUE;
|
||||
got_recursive_update = FALSE;
|
||||
|
||||
if (update_idle)
|
||||
g_source_remove (update_idle);
|
||||
/* We can't unreport damage, so let it run anyway. */
|
||||
|
||||
update_windows = NULL;
|
||||
update_idle = 0;
|
||||
|
||||
_gdk_windowing_before_process_all_updates ();
|
||||
|
||||
@@ -4258,11 +4255,11 @@ gdk_window_process_all_updates (void)
|
||||
redraw now so that it eventually happens,
|
||||
otherwise we could miss an update if nothing
|
||||
else schedules an update. */
|
||||
if (got_recursive_update && !update_idle)
|
||||
update_idle =
|
||||
gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
|
||||
gdk_window_update_idle,
|
||||
NULL, NULL);
|
||||
if (got_recursive_update && !damage_reported)
|
||||
{
|
||||
gdk_threads_periodic_damaged (gdk_window_repair, NULL, NULL);
|
||||
damage_reported = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user