pidgin: 59373a03: Don't emit the changed signal when modif...

qulogic at pidgin.im qulogic at pidgin.im
Mon Jun 4 04:25:47 EDT 2012


----------------------------------------------------------------------
Revision: 59373a03d9e865ce92fc864cf6c2d30b363c1f7b
Parent:   f6dea52f525502a9b7afb3567a22af0e007d39a5
Author:   qulogic at pidgin.im
Date:     06/03/12 16:03:35
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/59373a03d9e865ce92fc864cf6c2d30b363c1f7b

Changelog: 

Don't emit the changed signal when modifying the webview ourselves.

Changes against parent f6dea52f525502a9b7afb3567a22af0e007d39a5

  patched  pidgin/gtkwebview.c

-------------- next part --------------
============================================================
--- pidgin/gtkwebview.c	39161f4c3046fc6e88a7b3d26bca5ec404f8f3a6
+++ pidgin/gtkwebview.c	178fdf084ce032ee1226ed1e577e3a02b1667b2b
@@ -69,6 +69,7 @@ typedef struct _GtkWebViewPriv {
 	GtkWebViewButtons format_functions;
 	struct {
 		gboolean wbfo:1;	/* Whole buffer formatting only. */
+		gboolean block_changed:1;
 	} edit;
 
 } GtkWebViewPriv;
@@ -319,7 +320,9 @@ do_formatting(GtkWebView *webview, const
 		webkit_web_view_select_all(WEBKIT_WEB_VIEW(webview));
 	}
 
+	priv->edit.block_changed = TRUE;
 	webkit_dom_document_exec_command(dom, name, FALSE, value);
+	priv->edit.block_changed = FALSE;
 
 	if (priv->edit.wbfo) {
 		sel = webkit_dom_dom_window_get_selection(win);
@@ -371,7 +374,9 @@ editable_input_cb(GObject *target, WebKi
 static void
 editable_input_cb(GObject *target, WebKitDOMEvent *event, GtkWebView *webview)
 {
-	g_signal_emit(webview, signals[CHANGED], 0);
+	GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview);
+	if (!priv->edit.block_changed)
+		g_signal_emit(webview, signals[CHANGED], 0);
 }
 
 /******************************************************************************


More information about the Commits mailing list