Revision: 1551
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1551&view=rev
Author:   nadvornik
Date:     2009-03-17 18:30:53 +0000 (Tue, 17 Mar 2009)

Log Message:
-----------
fixed keyword tree redrawing

Modified Paths:
--------------
    trunk/src/bar_keywords.c

Modified: trunk/src/bar_keywords.c
===================================================================
--- trunk/src/bar_keywords.c    2009-03-17 00:05:13 UTC (rev 1550)
+++ trunk/src/bar_keywords.c    2009-03-17 18:30:53 UTC (rev 1551)
@@ -109,7 +109,8 @@
        gboolean expand_checked;
        gboolean collapse_unchecked;
        gboolean hide_unchecked;
-       
+
+       gint idle_id;   
        FileData *fd;
        gchar *key;
 };
@@ -416,7 +417,7 @@
        if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_METADATA)) && fd == 
pkd->fd) bar_pane_keywords_update(pkd);
 }
 
-static void bar_pane_keywords_changed(GtkTextBuffer *buffer, gpointer data)
+static gboolean bar_pane_keywords_changed_idle_cb(gpointer data)
 {
        PaneKeywordsData *pkd = data;
 
@@ -424,9 +425,20 @@
        bar_pane_keywords_write(pkd);
        bar_keyword_tree_sync(pkd);
        file_data_register_notify_func(bar_pane_keywords_notify_cb, pkd, 
NOTIFY_PRIORITY_LOW);
+       pkd->idle_id = -1;
+       return FALSE;
 }
 
+static void bar_pane_keywords_changed(GtkTextBuffer *buffer, gpointer data)
+{
+       PaneKeywordsData *pkd = data;
 
+       if (pkd->idle_id != -1) return;
+       /* higher prio than redraw */
+       pkd->idle_id = g_idle_add_full(G_PRIORITY_HIGH_IDLE, 
bar_pane_keywords_changed_idle_cb, pkd, NULL);
+}
+
+
 /*
  *-------------------------------------------------------------------
  * dnd
@@ -1182,7 +1194,7 @@
        PaneKeywordsData *pkd = data;
 
         if (pkd->click_tpath) gtk_tree_path_free(pkd->click_tpath);
-
+       if (pkd->idle_id != -1) g_source_remove(pkd->idle_id);
        file_data_unregister_notify_func(bar_pane_keywords_notify_cb, pkd);
 
        file_data_unref(pkd->fd);
@@ -1214,6 +1226,8 @@
        pkd->key = g_strdup(key);
        
        pkd->expand_checked = TRUE;
+       
+       pkd->idle_id = -1;
 
        hbox = gtk_hbox_new(FALSE, PREF_PAD_GAP);
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to