Index: src/vte.c
===================================================================
RCS file: /cvs/gnome/vte/src/vte.c,v
retrieving revision 1.451
diff -u -p -d -r1.451 vte.c
--- src/vte.c	12 Apr 2006 07:27:37 -0000	1.451
+++ src/vte.c	12 Apr 2006 08:45:04 -0000
@@ -4402,7 +4402,7 @@ vte_terminal_send_mouse_button_internal(
 }
 
 /* Send a mouse button click/release notification. */
-static void
+static gboolean
 vte_terminal_maybe_send_mouse_button(VteTerminal *terminal,
 				     GdkEventButton *event)
 {
@@ -4421,7 +4421,7 @@ vte_terminal_maybe_send_mouse_button(Vte
 		    !terminal->pvt->mouse_hilite_tracking &&
 		    !terminal->pvt->mouse_cell_motion_tracking &&
 		    !terminal->pvt->mouse_all_motion_tracking) {
-			return;
+			return FALSE;
 		}
 		break;
 	case GDK_BUTTON_RELEASE:
@@ -4429,11 +4429,11 @@ vte_terminal_maybe_send_mouse_button(Vte
 		    !terminal->pvt->mouse_hilite_tracking &&
 		    !terminal->pvt->mouse_cell_motion_tracking &&
 		    !terminal->pvt->mouse_all_motion_tracking) {
-			return;
+			return FALSE;
 		}
 		break;
 	default:
-		return;
+		return FALSE;
 		break;
 	}
 
@@ -4443,10 +4443,12 @@ vte_terminal_maybe_send_mouse_button(Vte
 						event->button : 0,
 						event->x - VTE_PAD_WIDTH,
 						event->y - VTE_PAD_WIDTH);
+
+	return TRUE;
 }
 
 /* Send a mouse motion notification. */
-static void
+static gboolean
 vte_terminal_maybe_send_mouse_drag(VteTerminal *terminal, GdkEventMotion *event)
 {
 	unsigned char cb = 0, cx = 0, cy = 0;
@@ -4459,11 +4461,11 @@ vte_terminal_maybe_send_mouse_drag(VteTe
 	case GDK_MOTION_NOTIFY:
 		if (!terminal->pvt->mouse_cell_motion_tracking &&
 		    !terminal->pvt->mouse_all_motion_tracking) {
-			return;
+			return FALSE;
 		}
 		if (!terminal->pvt->mouse_all_motion_tracking) {
 			if (terminal->pvt->mouse_last_button == 0) {
-				return;
+				return FALSE;
 			}
 			if ((floor((event->x - VTE_PAD_WIDTH) /
 				   terminal->char_width) ==
@@ -4473,12 +4475,12 @@ vte_terminal_maybe_send_mouse_drag(VteTe
 				   terminal->char_height) ==
 			     floor(terminal->pvt->mouse_last_y /
 				   terminal->char_height))) {
-				return;
+				return FALSE;
 			}
 		}
 		break;
 	default:
-		return;
+		return FALSE;
 		break;
 	}
 
@@ -4525,6 +4527,8 @@ vte_terminal_maybe_send_mouse_drag(VteTe
 	/* Send the event to the child. */
 	snprintf(buf, sizeof(buf), "%sM%c%c%c", _VTE_CAP_CSI, cb, cx, cy);
 	vte_terminal_feed_child(terminal, buf, strlen(buf));
+
+	return TRUE;
 }
 
 /* Clear all match hilites. */
@@ -5880,8 +5884,7 @@ vte_terminal_button_press(GtkWidget *wid
 		/* If we haven't done anything yet, try sending the mouse
 		 * event to the app. */
 		if (handled == FALSE) {
-			vte_terminal_maybe_send_mouse_button(terminal, event);
-			handled = TRUE;
+			handled = vte_terminal_maybe_send_mouse_button(terminal, event);
 		}
 		break;
 	case GDK_2BUTTON_PRESS:
@@ -5905,6 +5908,7 @@ vte_terminal_button_press(GtkWidget *wid
 							      event->x - VTE_PAD_WIDTH,
 							      event->y - VTE_PAD_WIDTH,
 							      FALSE);
+				handled = TRUE;
 			}
 			break;
 		case 2:
@@ -5934,6 +5938,7 @@ vte_terminal_button_press(GtkWidget *wid
 							      event->x - VTE_PAD_WIDTH,
 							      event->y - VTE_PAD_WIDTH,
 							      FALSE);
+				handled = TRUE;
 			}
 			break;
 		case 2:
@@ -5955,7 +5960,7 @@ vte_terminal_button_press(GtkWidget *wid
 	terminal->pvt->mouse_last_x = event->x - VTE_PAD_WIDTH;
 	terminal->pvt->mouse_last_y = event->y - VTE_PAD_WIDTH;
 
-	return TRUE;
+	return handled;
 }
 
 /* Read and handle a pointing device buttonrelease event. */
@@ -6023,8 +6028,7 @@ vte_terminal_button_release(GtkWidget *w
 			break;
 		}
 		if (handled == FALSE) {
-			vte_terminal_maybe_send_mouse_button(terminal, event);
-			handled = TRUE;
+			handled = vte_terminal_maybe_send_mouse_button(terminal, event);
 		}
 		break;
 	default:
@@ -6041,7 +6045,7 @@ vte_terminal_button_release(GtkWidget *w
 	terminal->pvt->mouse_last_x = event->x - VTE_PAD_WIDTH;
 	terminal->pvt->mouse_last_y = event->y - VTE_PAD_WIDTH;
 
-	return TRUE;
+	return handled;
 }
 
 /* Handle receiving or losing focus. */
