aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-06-06 00:52:45 +0800
committerChris Lahey <clahey@src.gnome.org>2002-06-06 00:52:45 +0800
commit3146e7f80ed50c60f2e96543fec1b9e4de302d37 (patch)
tree0853d43ad5e4b1afd5bdccd8a5b12bcb80904d4f /widgets
parent882e28269d85c84086b4fee1938f3cb11c82ce6f (diff)
downloadgsoc2013-evolution-3146e7f80ed50c60f2e96543fec1b9e4de302d37.tar
gsoc2013-evolution-3146e7f80ed50c60f2e96543fec1b9e4de302d37.tar.gz
gsoc2013-evolution-3146e7f80ed50c60f2e96543fec1b9e4de302d37.tar.bz2
gsoc2013-evolution-3146e7f80ed50c60f2e96543fec1b9e4de302d37.tar.lz
gsoc2013-evolution-3146e7f80ed50c60f2e96543fec1b9e4de302d37.tar.xz
gsoc2013-evolution-3146e7f80ed50c60f2e96543fec1b9e4de302d37.tar.zst
gsoc2013-evolution-3146e7f80ed50c60f2e96543fec1b9e4de302d37.zip
Added debugging printfs. (e_text_request_paste): Fixed the order of
2002-06-05 Christopher James Lahey <clahey@ximian.com> * gal/e-text/e-text.c: Added debugging printfs. (e_text_request_paste): Fixed the order of setting last_type_request before calling gtk_selection_convert due to a reentrancy bug. svn path=/trunk/; revision=17119
Diffstat (limited to 'widgets')
-rw-r--r--widgets/text/e-text.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index dfc15ec685..836c7ffa2a 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -58,6 +58,7 @@
#include <libart_lgpl/art_rgb_bitmap_affine.h>
#define BORDER_INDENT 4
+#define d(x)
enum {
E_TEXT_CHANGED,
@@ -3659,13 +3660,15 @@ e_text_request_paste (EText *text)
if (type >= format_count) {
if (text->queued_requests) {
guint32 *new_time = text->queued_requests->data;
- text->queued_requests = g_list_remove_link (text->queued_requests, text->queued_requests);
+ text->queued_requests = g_list_remove_link (text->queued_requests, text->queued_requests);
text->last_time_request = *new_time;
g_free (new_time);
type = -1;
+ continue;
} else {
text->last_type_request = -1;
+ d(g_print ("Setting last_type_request to %d at line %d\n", text->last_type_request, __LINE__));
text->last_time_request = 0;
return;
}
@@ -3674,6 +3677,11 @@ e_text_request_paste (EText *text)
format_atom = atoms [type];
}
+ /* This must come before the gtk_selection_convert because sometimes _selection_received is called reentrantly. */
+
+ text->last_type_request = type;
+ d(g_print ("Setting last_type_request to %d at line %d\n", text->last_type_request, __LINE__));
+
/* And request the format target for the required selection */
invisible = e_text_get_invisible(text);
gtk_selection_convert(invisible,
@@ -3681,7 +3689,6 @@ e_text_request_paste (EText *text)
format_atom,
text->last_time_request);
- text->last_type_request = type;
return;
}
@@ -3693,6 +3700,7 @@ _selection_received (GtkInvisible *invisible,
{
init_atoms ();
if (selection_data->length < 0) {
+ d(g_print ("Calling e_text_request_paste at line %d\n", __LINE__));
e_text_request_paste (text);
return;
} else if (selection_data->type == atoms[E_STRING_ATOM]) {
@@ -3719,12 +3727,14 @@ _selection_received (GtkInvisible *invisible,
e_text_command(text->tep, &command, text);
}
text->last_type_request = -1;
+ d(g_print ("Setting last_type_request to %d at line %d\n", text->last_type_request, __LINE__));
if (text->queued_requests) {
SelectionAndTime *new_request = text->queued_requests->data;
text->queued_requests = g_list_remove_link (text->queued_requests, text->queued_requests);
text->last_time_request = new_request->time;
text->last_selection_request = new_request->selection;
g_free (new_request);
+ d(g_print ("Calling e_text_request_paste at line %d\n", __LINE__));
e_text_request_paste (text);
}
}
@@ -3737,6 +3747,7 @@ e_text_get_selection(EText *text, GdkAtom selection, guint32 time)
if (text->last_type_request == -1) {
text->last_time_request = time;
text->last_selection_request = selection;
+ d(g_print ("Calling e_text_request_paste at line %d\n", __LINE__));
e_text_request_paste (text);
} else {
SelectionAndTime *new_request = g_new (SelectionAndTime, 1);
@@ -4158,6 +4169,7 @@ e_text_init (EText *text)
text->allow_newlines = TRUE;
text->last_type_request = -1;
+ d(g_print ("Setting last_type_request to %d at line %d\n", text->last_type_request, __LINE__));
text->last_time_request = 0;
text->queued_requests = NULL;