[gnumeric] Clipboard: better debug.



commit 77db9b411a2c4ee5c4d7ae5885722e585f3d2682
Author: Morten Welinder <terra gnome org>
Date:   Thu Aug 2 19:49:12 2012 -0400

    Clipboard: better debug.

 src/gui-clipboard.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/gui-clipboard.c b/src/gui-clipboard.c
index 792b41e..4c591db 100644
--- a/src/gui-clipboard.c
+++ b/src/gui-clipboard.c
@@ -480,8 +480,7 @@ table_content_received (GtkClipboard *clipboard, GtkSelectionData *sel,
 	/* Nothing on clipboard? */
 	if (gtk_selection_data_get_length (sel) < 0) {
 		;
-	} else if (target == gdk_atom_intern (GNUMERIC_ATOM_NAME,
-						   FALSE)) {
+	} else if (target == gdk_atom_intern (GNUMERIC_ATOM_NAME, FALSE)) {
 		/* The data is the gnumeric specific XML interchange format */
 		GOIOContext *io_context =
 			go_io_context_new (GO_CMD_CONTEXT (wbcg));
@@ -983,6 +982,9 @@ static gint
 x_clipboard_clear_cb (GtkClipboard *clipboard,
 		      GObject *obj)
 {
+	if (debug_clipboard ())
+		g_printerr ("Lost clipboard ownership.\n");
+
 	gnm_app_clipboard_clear (FALSE);
 
 	return TRUE;
@@ -1117,6 +1119,8 @@ gnm_x_claim_clipboard (WBCGtk *wbcg)
 		(GtkClipboardClearFunc) x_clipboard_clear_cb,
 		gnm_app_get_app ());
 	if (ret) {
+		if (debug_clipboard ())
+			g_printerr ("Clipboard successfully claimed.\n");
 		set_clipman_targets (display, targets, n_targets);
 		ret = gtk_clipboard_set_with_owner (
 			gtk_clipboard_get_for_display (display,
@@ -1125,6 +1129,9 @@ gnm_x_claim_clipboard (WBCGtk *wbcg)
 			(GtkClipboardGetFunc) x_clipboard_get_cb,
 			NULL,
 			gnm_app_get_app ());
+	} else {
+		if (debug_clipboard ())
+			g_printerr ("Failed to claim clipboard.\n");
 	}
 	if (exportable || imageable)
 		gtk_target_table_free (targets, n_targets);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]