X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxoptions.c;h=0737c79bac2555db319008327d9bf21dbcb9f75c;hb=eca734a86610900053cd02af3e78d7983fe3bb40;hp=d3a8835d8ecc01cd6d7ba7ca35e65b0b41e75429;hpb=093d989d136cc87cbb1c739b3ddea5337cf2b702;p=xboard.git diff --git a/gtk/xoptions.c b/gtk/xoptions.c index d3a8835..0737c79 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -683,10 +683,10 @@ MemoEvent(GtkWidget *widget, GdkEvent *event, gpointer gdata) } if(memo->value == 250 // kludge to recognize ICS Console and Chat panes && gtk_text_buffer_get_selection_bounds(memo->handle, NULL, NULL) ) { -printf("*** selected\n"); gtk_text_buffer_get_selection_bounds(memo->handle, &start, &end); // only return selected text - index = -1; // kludge to indicate omething was selected + index = -1; // kludge to indicate something was selected } else { + if(abs(button) == 3 && gtk_text_buffer_get_selection_bounds(memo->handle, NULL, NULL)) return FALSE; // normal context menu // GTK_TODO: is this really the most efficient way to get the character at the mouse cursor??? gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(widget), GTK_TEXT_WINDOW_WIDGET, w, h, &x, &y); gtk_text_view_get_iter_at_location(GTK_TEXT_VIEW(widget), &start, x, y); @@ -699,7 +699,7 @@ printf("*** selected\n"); } /* get text from textbuffer */ val = gtk_text_buffer_get_text (memo->handle, &start, &end, FALSE); - break; + if(strlen(val) != index) break; // if we clicked behind all text, fall through to do default action default: return FALSE; // should not happen }