Update of /cvsroot/ufraw/ufraw
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv700

Modified Files:
        ufraw_preview.c ufraw_ui.h 
Log Message:
The function g_idle_remove_by_data() removes just one idle function.
We fix some bad interactions and duplicate function calls when controls
are adjusted too fast.


Index: ufraw_ui.h
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_ui.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- ufraw_ui.h  3 Oct 2009 06:55:56 -0000       1.23
+++ ufraw_ui.h  20 Oct 2009 02:57:13 -0000      1.24
@@ -188,6 +188,7 @@
     int OverUnderTicker;
     /* The event source number when the highlight blink function is enabled. */
     guint BlinkTimer;
+    guint DrawCropID;
 } preview_data;
 
 /* Response can be any unique positive integer */

Index: ufraw_preview.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_preview.c,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -d -r1.285 -r1.286
--- ufraw_preview.c     13 Oct 2009 03:15:54 -0000      1.285
+++ ufraw_preview.c     20 Oct 2009 02:57:13 -0000      1.286
@@ -875,7 +875,8 @@
     render_init(data);
     ufraw_convert_image_init_phase(data->UF);
     data->RenderSubArea = 0;
-    g_idle_remove_by_data(data);
+    while (g_idle_remove_by_data(data))
+       ;
     g_idle_add_full(G_PRIORITY_DEFAULT_IDLE-10,
            (GSourceFunc)(render_prepare), data, NULL);
 }
@@ -2054,8 +2055,9 @@
     CFG->drawLines = saveDrawLines;
     // Draw lines when idle if necessary
     if (CFG->drawLines>0 && data->BlinkTimer==0) {
-       g_idle_remove_by_data(data);
-       g_idle_add_full(G_PRIORITY_DEFAULT_IDLE+30,
+       if (data->DrawCropID != 0)
+           g_source_remove(data->DrawCropID);
+       data->DrawCropID = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE+30,
                (GSourceFunc)(preview_draw_crop), data, NULL);
     }
     update_shrink_ranges(data);
@@ -2848,7 +2850,9 @@
     if (data->FreezeDialog) return;
 
     if (valuep==&CFG->drawLines) {
-       g_idle_add_full(G_PRIORITY_DEFAULT_IDLE+30,
+       if (data->DrawCropID != 0)
+           g_source_remove(data->DrawCropID);
+       data->DrawCropID = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE+30,
                (GSourceFunc)(preview_draw_crop), data, NULL);
     }
 }
@@ -5250,6 +5254,7 @@
 
     data->AspectRatio = 0.0;
     data->BlinkTimer = 0;
+    data->DrawCropID = 0;
     for (i=0; i<num_buttons; i++) {
        data->ControlButton[i] = NULL;
        data->ButtonMnemonic[i] = 0;
@@ -5677,11 +5682,14 @@
     for (i=0; i<cursor_num; i++)
        gdk_cursor_unref(data->Cursor[i]);
     /* Make sure that there are no preview idle task remaining */
-    g_idle_remove_by_data(data);
+    while (g_idle_remove_by_data(data))
+       ;
     if (data->BlinkTimer) {
        g_source_remove(data->BlinkTimer);
        data->BlinkTimer = 0;
     }
+    if (data->DrawCropID != 0)
+       g_source_remove(data->DrawCropID);
 
     if ( status==GTK_RESPONSE_OK ) {
        gboolean SaveRC = FALSE;


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
ufraw-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-cvs

Reply via email to