[gnumeric] GUI: Fix clipboard criticals on exit.



commit 06310935fcefa3d34a799fc1011f8bcc3e7702c7
Author: Morten Welinder <terra gnome org>
Date:   Fri Jun 22 10:55:22 2012 -0400

    GUI: Fix clipboard criticals on exit.
    
    Fixes #678580.

 ChangeLog                 |    5 +++++
 NEWS                      |    1 +
 src/dialogs/ChangeLog     |    6 ++++++
 src/dialogs/dialog-quit.c |    4 ++--
 src/gui-clipboard.c       |    5 ++++-
 5 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b7d9adb..8576755 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-22  Morten Welinder  <terra gnome org>
+
+	* src/gui-clipboard.c (gnm_x_store_clipboard_if_needed): More
+	debug.
+
 2012-06-18  Morten Welinder  <terra gnome org>
 
 	* src/xml-sax-write.c (gnm_xml_out_add_gocolor): Handle alpha.
diff --git a/NEWS b/NEWS
index 6a3d4c7..35f8a66 100644
--- a/NEWS
+++ b/NEWS
@@ -40,6 +40,7 @@ Morten:
 	* Improve handling of expressions in validations.  [#674914]
 	* Improve handling of expressions in conditional formats.  [#674954]
 	* Fix problems with style hash and equality.  [#675955]
+	* Fix clipboard criticals on exit.  [#678580]
 
 --------------------------------------------------------------------------
 Gnumeric 1.11.3
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 7a1c6bc..40b755f 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-22  Morten Welinder  <terra gnome org>
+
+	* dialog-quit.c (dialog_quit): Take into account that quit may be
+	called from a wbcg that is not the owner of the selection.  Fixes
+	#678580.
+
 2012-06-17  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* autofilter-expression.ui: add missing label fields
diff --git a/src/dialogs/dialog-quit.c b/src/dialogs/dialog-quit.c
index 9831ec1..2d8f056 100644
--- a/src/dialogs/dialog-quit.c
+++ b/src/dialogs/dialog-quit.c
@@ -432,14 +432,14 @@ dialog_quit (WBCGtk *wbcg)
 			return;
 	}
 
-	gnm_x_store_clipboard_if_needed (wb_control_get_workbook (wbc));
-
 	l = g_list_copy (gnm_app_workbook_list ());
 	while (l) {
 		Workbook *wb = l->data;
 		l = g_list_remove (l, wb);
 		go_doc_set_dirty (GO_DOC (wb), FALSE);
 
+		gnm_x_store_clipboard_if_needed (wb);
+
 		/* This is how we kill it?  Ugh!  */
 		g_object_unref (wb);
 	}
diff --git a/src/gui-clipboard.c b/src/gui-clipboard.c
index 286c800..792b41e 100644
--- a/src/gui-clipboard.c
+++ b/src/gui-clipboard.c
@@ -1155,8 +1155,11 @@ gnm_x_store_clipboard_if_needed (Workbook *wb)
 				(gtk_widget_get_display
 				 (GTK_WIDGET (wbcg_toplevel (wbcg))),
 				 GDK_SELECTION_CLIPBOARD);
-			if (gtk_clipboard_get_owner (clip) == gnm_app_get_app ())
+			if (gtk_clipboard_get_owner (clip) == gnm_app_get_app ()) {
+				if (debug_clipboard ())
+					g_printerr ("Handing off clipboard\n");
 				gtk_clipboard_store (clip);
+			}
 		}
 	}
 }



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