changeset 4525:5426b09731d6

[gaim-migrate @ 4803] (21:27:28) Robot101: er, saving prefs every pixel you move the blist is very stupid. essentially, this behavior is so stupid as to amount to being a bug in and of itself even though we cannot _prove_ it does any harm. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 05 Feb 2003 02:30:28 +0000
parents 78403c4f62dc
children e5b024352f9e
files src/buddy.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy.c	Wed Feb 05 00:52:02 2003 +0000
+++ b/src/buddy.c	Wed Feb 05 02:30:28 2003 +0000
@@ -2316,6 +2316,11 @@
 	}
 }
 
+static gboolean delayed_save_prefs(gpointer data) {
+	save_prefs();
+	return FALSE;
+}
+
 static gboolean configure_blist_window(GtkWidget *w, GdkEventConfigure *event, gpointer data) {
 	/* unfortunately GdkEventConfigure ignores the window gravity, but  *
 	 * the only way we have of setting the position doesn't. we have to *
@@ -2337,9 +2342,14 @@
 	    blist_pos.y = y;
 	    blist_pos.width = event->width;
 	    blist_pos.height = event->height;
-	    save_prefs();
+
+	    if (!g_main_context_find_source_by_user_data(NULL, &delayed_save_prefs)) {
+	      debug_printf("queueing save of blist prefs\n");
+	      g_timeout_add(5000, delayed_save_prefs, &delayed_save_prefs);
+	    }
 	  }
 	}
+
 	return FALSE;
 }