diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-06-13 04:08:47 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-06-13 04:08:47 +0000 |
commit | 0d22665e895bb4ddbe06cdb3cfd6f74f9bd2a1ab (patch) | |
tree | 7ee00fe2aba8ef01b4d2125be26a0eeac5a6a063 /src/textview.c | |
parent | 251d6830c324a8f7302fceb6fd96ae3ec0078994 (diff) |
fixed handling of button release event.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2897 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/textview.c')
-rw-r--r-- | src/textview.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/textview.c b/src/textview.c index 78d79f77..ff8047a1 100644 --- a/src/textview.c +++ b/src/textview.c @@ -626,7 +626,7 @@ static gboolean textview_part_widget_button_pressed(GtkWidget *widget, GdkEventButton *event, gpointer data) { - return FALSE; + return TRUE; } static gboolean textview_part_widget_exposed(GtkWidget *widget, @@ -662,8 +662,8 @@ static void textview_add_part_widget(TextView *textview, GtkTextIter *iter, GtkWidget *ebox; GtkWidget *label; GtkWidget *arrow; - GdkColor bg = {0, 0xd000, 0xe000, 0xffff}; - GdkColor fg = {0, 0x7000, 0xb000, 0xffff}; + GdkColor bg = {0, 0xd000, 0xd800, 0xffff}; + GdkColor fg = {0, 0x7000, 0x9000, 0xffff}; buffer = gtk_text_view_get_buffer(text); gtk_text_buffer_insert(buffer, iter, "\n", 1); @@ -1942,6 +1942,10 @@ static gboolean textview_event_after(GtkWidget *widget, GdkEvent *event, if (bevent->button != 1 && bevent->button != 2) return FALSE; + /* don't process child widget's event */ + if (gtk_text_view_get_window(GTK_TEXT_VIEW(widget), GTK_TEXT_WINDOW_TEXT) != bevent->window) + return FALSE; + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget)); /* don't follow a link if the user has selected something */ @@ -1950,7 +1954,7 @@ static gboolean textview_event_after(GtkWidget *widget, GdkEvent *event, return FALSE; gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(widget), - GTK_TEXT_WINDOW_WIDGET, + GTK_TEXT_WINDOW_TEXT, bevent->x, bevent->y, &x, &y); gtk_text_view_get_iter_at_location(GTK_TEXT_VIEW(widget), &iter, x, y); on_link = textview_get_link_tag_bounds(textview, &iter, &start, &end); @@ -2050,7 +2054,9 @@ static gboolean textview_motion_notify(GtkWidget *widget, TextView *textview) { gint x, y; - + + if (gtk_text_view_get_window(GTK_TEXT_VIEW(widget), GTK_TEXT_WINDOW_TEXT) != event->window) + return FALSE; gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(widget), GTK_TEXT_WINDOW_WIDGET, event->x, event->y, &x, &y); |