Mercurial > geeqie.yaz
diff src/pixbuf-renderer.c @ 1523:24a12aa0cb54
Fix up event source ids type: gint -> guint.
Functions like g_timeout_add() or g_idle_add() return a guint
greater than 0, but in most places it was wrongly stored as int
and initialized to -1.
This broke assertions matching in g_source_remove() for example
since id was always greater than 0 even when timer was not set
(-1 was casted to the biggest guint).
author | zas_ |
---|---|
date | Mon, 06 Apr 2009 22:13:54 +0000 |
parents | 5986d49c62f9 |
children | d960b1743ad8 |
line wrap: on
line diff
--- a/src/pixbuf-renderer.c Mon Apr 06 21:52:49 2009 +0000 +++ b/src/pixbuf-renderer.c Mon Apr 06 22:13:54 2009 +0000 @@ -508,7 +508,7 @@ pr->scroll_reset = PR_SCROLL_RESET_TOPLEFT; - pr->draw_idle_id = -1; + pr->draw_idle_id = 0; pr->tile_width = PR_TILE_SIZE; pr->tile_height = PR_TILE_SIZE; @@ -518,7 +518,7 @@ pr->tile_cache_max = PR_CACHE_SIZE_DEFAULT; - pr->scroller_id = -1; + pr->scroller_id = 0; pr->scroller_overlay = -1; pr->x_mouse = -1; @@ -1266,10 +1266,10 @@ static void pr_scroller_timer_set(PixbufRenderer *pr, gboolean start) { - if (pr->scroller_id != -1) + if (pr->scroller_id) { g_source_remove(pr->scroller_id); - pr->scroller_id = -1; + pr->scroller_id = 0; } if (start) @@ -1309,7 +1309,7 @@ static void pr_scroller_stop(PixbufRenderer *pr) { - if (pr->scroller_id == -1) return; + if (!pr->scroller_id) return; pixbuf_renderer_overlay_remove(pr, pr->scroller_overlay); pr->scroller_overlay = -1; @@ -2817,11 +2817,11 @@ if ((!pr->pixbuf && !pr->source_tiles_enabled) || (!pr->draw_queue && !pr->draw_queue_2pass) || - pr->draw_idle_id == -1) + !pr->draw_idle_id) { pr_render_complete_signal(pr); - pr->draw_idle_id = -1; + pr->draw_idle_id = 0; return FALSE; } @@ -2893,7 +2893,7 @@ { pr_render_complete_signal(pr); - pr->draw_idle_id = -1; + pr->draw_idle_id = 0; return FALSE; } @@ -2928,8 +2928,11 @@ pr_queue_list_free(pr->draw_queue_2pass); pr->draw_queue_2pass = NULL; - if (pr->draw_idle_id != -1) g_source_remove(pr->draw_idle_id); - pr->draw_idle_id = -1; + if (pr->draw_idle_id) + { + g_source_remove(pr->draw_idle_id); + pr->draw_idle_id = 0; + } } static void pr_queue_merge(QueueData *parent, QueueData *qd) @@ -3087,9 +3090,13 @@ if (w < 1 || h < 1) return; if (pr_queue_to_tiles(pr, nx, ny, w, h, clamp, render, new_data, only_existing) && - ((!pr->draw_queue && !pr->draw_queue_2pass) || pr->draw_idle_id == -1)) + ((!pr->draw_queue && !pr->draw_queue_2pass) || !pr->draw_idle_id)) { - if (pr->draw_idle_id != -1) g_source_remove(pr->draw_idle_id); + if (pr->draw_idle_id) + { + g_source_remove(pr->draw_idle_id); + pr->draw_idle_id = 0; + } pr_queue_schedule_next_draw(pr, TRUE); } } @@ -3710,7 +3717,7 @@ pr = PIXBUF_RENDERER(widget); - if (pr->scroller_id != -1) + if (pr->scroller_id) { pr->scroller_xpos = bevent->x; pr->scroller_ypos = bevent->y; @@ -3759,7 +3766,7 @@ pr = PIXBUF_RENDERER(widget); - if (pr->scroller_id != -1) return TRUE; + if (pr->scroller_id) return TRUE; switch (bevent->button) { @@ -3798,7 +3805,7 @@ pr = PIXBUF_RENDERER(widget); - if (pr->scroller_id != -1) + if (pr->scroller_id) { pr_scroller_stop(pr); return TRUE; @@ -3834,7 +3841,7 @@ pr = PIXBUF_RENDERER(widget); - if (pr->scroller_id != -1) + if (pr->scroller_id) { pr->scroller_xpos = pr->scroller_x; pr->scroller_ypos = pr->scroller_y;