summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Techet <techet@gmail.com>2011-08-17 22:39:52 +0200
committerJiří Techet <techet@gmail.com>2011-08-21 00:51:14 +0200
commit3bfa0341f2b95d7a491b0f3c4b664ab9ea8bab5e (patch)
tree4a8546498971e63809bbd104c1a075a295a84c27
parent011de7f0bc97f49a926f0fcd0286e81a9927eeb4 (diff)
downloadlibchamplain-3bfa0341f2b95d7a491b0f3c4b664ab9ea8bab5e.tar.gz
Use CLUTTER_PRIORITY_REDRAW for all idle functions
Clutter uses CLUTTER_PRIORITY_REDRAW for all its animations so we have to use at least this priority in order to avoid starvation in certain situations. There doesn't seem to be any need for other priorities at the moment.
-rw-r--r--champlain/champlain-file-cache.c2
-rw-r--r--champlain/champlain-label.c2
-rw-r--r--champlain/champlain-marker.c2
-rw-r--r--champlain/champlain-memphis-renderer.c2
-rw-r--r--champlain/champlain-path-layer.c2
-rw-r--r--champlain/champlain-scale.c2
-rw-r--r--champlain/champlain-view.c5
7 files changed, 8 insertions, 9 deletions
diff --git a/champlain/champlain-file-cache.c b/champlain/champlain-file-cache.c
index 90d757c..02e019d 100644
--- a/champlain/champlain-file-cache.c
+++ b/champlain/champlain-file-cache.c
@@ -922,7 +922,7 @@ void
champlain_file_cache_purge_on_idle (ChamplainFileCache *file_cache)
{
g_return_if_fail (CHAMPLAIN_IS_FILE_CACHE (file_cache));
- g_idle_add_full (G_PRIORITY_DEFAULT,
+ g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
(GSourceFunc) purge_on_idle,
g_object_ref (file_cache),
(GDestroyNotify) g_object_unref);
diff --git a/champlain/champlain-label.c b/champlain/champlain-label.c
index 39c27bf..b291eb9 100644
--- a/champlain/champlain-label.c
+++ b/champlain/champlain-label.c
@@ -915,7 +915,7 @@ champlain_label_queue_redraw (ChamplainLabel *label)
if (!priv->redraw_id)
{
priv->redraw_id =
- g_idle_add_full (G_PRIORITY_DEFAULT,
+ g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
(GSourceFunc) redraw_on_idle,
g_object_ref (label),
(GDestroyNotify) g_object_unref);
diff --git a/champlain/champlain-marker.c b/champlain/champlain-marker.c
index 37e89be..ec420e0 100644
--- a/champlain/champlain-marker.c
+++ b/champlain/champlain-marker.c
@@ -818,7 +818,7 @@ static void
on_animation_completed (G_GNUC_UNUSED ClutterAnimation *animation,
ChamplainMarker *marker)
{
- g_idle_add_full (G_PRIORITY_DEFAULT,
+ g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
(GSourceFunc) on_idle,
g_object_ref (marker),
(GDestroyNotify) g_object_unref);
diff --git a/champlain/champlain-memphis-renderer.c b/champlain/champlain-memphis-renderer.c
index 1b7b61c..e1ef811 100644
--- a/champlain/champlain-memphis-renderer.c
+++ b/champlain/champlain-memphis-renderer.c
@@ -396,7 +396,7 @@ memphis_worker_thread (gpointer worker_data,
cairo_destroy (cr);
}
- clutter_threads_add_idle_full (G_PRIORITY_DEFAULT, tile_loaded_cb, data, NULL);
+ clutter_threads_add_idle_full (CLUTTER_PRIORITY_REDRAW, tile_loaded_cb, data, NULL);
}
diff --git a/champlain/champlain-path-layer.c b/champlain/champlain-path-layer.c
index 145ca46..a10402d 100644
--- a/champlain/champlain-path-layer.c
+++ b/champlain/champlain-path-layer.c
@@ -744,7 +744,7 @@ schedule_redraw (ChamplainPathLayer *layer)
if (!layer->priv->redraw_scheduled)
{
layer->priv->redraw_scheduled = TRUE;
- g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
+ g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
(GSourceFunc) redraw_path,
g_object_ref (layer),
(GDestroyNotify) g_object_unref);
diff --git a/champlain/champlain-scale.c b/champlain/champlain-scale.c
index aab30fb..34f5f06 100644
--- a/champlain/champlain-scale.c
+++ b/champlain/champlain-scale.c
@@ -461,7 +461,7 @@ schedule_redraw (ChamplainScale *scale)
if (!scale->priv->redraw_scheduled)
{
scale->priv->redraw_scheduled = TRUE;
- g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
+ g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
(GSourceFunc) redraw_scale,
g_object_ref (scale),
(GDestroyNotify) g_object_unref);
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 7c406d0..543bf23 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -606,7 +606,7 @@ champlain_view_allocate (ClutterActor *actor,
if (priv->viewport_width != width || priv->viewport_height != height)
{
- g_idle_add_full (G_PRIORITY_HIGH_IDLE,
+ g_idle_add_full (CLUTTER_PRIORITY_REDRAW,
(GSourceFunc) _update_idle_cb,
g_object_ref (view),
(GDestroyNotify) g_object_unref);
@@ -1994,8 +1994,7 @@ view_load_visible_tiles (ChamplainView *view)
g_object_ref (tile);
g_object_ref (priv->map_source);
- /* set priority high, otherwise tiles will be loaded after panning is done */
- g_idle_add_full (G_PRIORITY_HIGH_IDLE, (GSourceFunc) fill_tile_cb, data, NULL);
+ g_idle_add_full (CLUTTER_PRIORITY_REDRAW, (GSourceFunc) fill_tile_cb, data, NULL);
}
x += dirs[turn % 4 + 1];