Ensure recursing gdk_window_process_all_updates works
There are two issues here. First of all an ignored update didn't use to unset update_idle which could cause all further idle repaints to be ignored. (Bug #591583) Secondly, if we ignore the process_all_updates we may end up not updating the windows in update_windows unless something else triggers an update. So, we handle this by checking for recursions and scheduling a new update at the end of the outermost process_all_updates.
This commit is contained in:
@ -4875,10 +4875,10 @@ gdk_window_schedule_update (GdkWindow *window)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!update_idle)
|
if (!update_idle)
|
||||||
{
|
update_idle =
|
||||||
update_idle = gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
|
gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
|
||||||
gdk_window_update_idle, NULL, NULL);
|
gdk_window_update_idle,
|
||||||
}
|
NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -5187,11 +5187,19 @@ gdk_window_process_all_updates (void)
|
|||||||
GSList *old_update_windows = update_windows;
|
GSList *old_update_windows = update_windows;
|
||||||
GSList *tmp_list = update_windows;
|
GSList *tmp_list = update_windows;
|
||||||
static gboolean in_process_all_updates = FALSE;
|
static gboolean in_process_all_updates = FALSE;
|
||||||
|
static gboolean got_recursive_update = FALSE;
|
||||||
|
|
||||||
if (in_process_all_updates)
|
if (in_process_all_updates)
|
||||||
return;
|
{
|
||||||
|
/* 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;
|
in_process_all_updates = TRUE;
|
||||||
|
got_recursive_update = FALSE;
|
||||||
|
|
||||||
if (update_idle)
|
if (update_idle)
|
||||||
g_source_remove (update_idle);
|
g_source_remove (update_idle);
|
||||||
@ -5227,6 +5235,16 @@ gdk_window_process_all_updates (void)
|
|||||||
_gdk_windowing_after_process_all_updates ();
|
_gdk_windowing_after_process_all_updates ();
|
||||||
|
|
||||||
in_process_all_updates = FALSE;
|
in_process_all_updates = FALSE;
|
||||||
|
|
||||||
|
/* If we ignored a recursive call, schedule a
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user