[gtk-vnc-devel] [PATCH] Propagate mouse events



I needed to add mouse handlers in kvm-test and this seemed to be the only way to get things to work. If anyone knows a better solution, I'm all ears.

Regards,

Anthony Liguori
Mouse handlers should allow signal to propagate so that other users can get
mouse events.

diff -r 09b578682a9c src/vncdisplay.c
--- a/src/vncdisplay.c	Tue Oct 23 22:16:04 2007 -0500
+++ b/src/vncdisplay.c	Tue Oct 23 22:18:35 2007 -0500
@@ -238,10 +238,10 @@ static gboolean button_event(GtkWidget *
 	int n;
 
 	if (priv->gvnc == NULL || !gvnc_is_initialized(priv->gvnc))
-		return TRUE;
+		return FALSE;
 
 	if (priv->read_only)
-		return TRUE;
+		return FALSE;
 
 	if ((priv->grab_pointer || !priv->absolute) &&
 	    !priv->in_pointer_grab &&
@@ -262,7 +262,7 @@ static gboolean button_event(GtkWidget *
 				   0x7FFF, 0x7FFF);
 	}
 
-	return TRUE;
+	return FALSE;
 }
 
 static gboolean scroll_event(GtkWidget *widget, GdkEventScroll *scroll,
@@ -272,10 +272,10 @@ static gboolean scroll_event(GtkWidget *
 	int mask;
 
 	if (priv->gvnc == NULL || !gvnc_is_initialized(priv->gvnc))
-		return TRUE;
+		return FALSE;
 
 	if (priv->read_only)
-		return TRUE;
+		return FALSE;
 
 	if (scroll->direction == GDK_SCROLL_UP)
 		mask = (1 << 3);
@@ -286,7 +286,7 @@ static gboolean scroll_event(GtkWidget *
 	else if (scroll->direction == GDK_SCROLL_RIGHT)
 		mask = (1 << 6);
 	else
-		return TRUE;
+		return FALSE;
 
 	if (priv->absolute) {
 		gvnc_pointer_event(priv->gvnc, priv->button_mask | mask,
@@ -300,7 +300,7 @@ static gboolean scroll_event(GtkWidget *
 				   0x7FFF, 0x7FFF);
 	}
 
-	return TRUE;
+	return FALSE;
 }
 
 static gboolean motion_event(GtkWidget *widget, GdkEventMotion *motion,
@@ -310,13 +310,13 @@ static gboolean motion_event(GtkWidget *
 	int dx, dy;
 
 	if (priv->gvnc == NULL || !gvnc_is_initialized(priv->gvnc))
-		return TRUE;
+		return FALSE;
 
 	if (!priv->absolute && !priv->in_pointer_grab)
-		return TRUE;
+		return FALSE;
 
 	if (priv->read_only)
-		return TRUE;
+		return FALSE;
 
 	if (!priv->absolute && priv->in_pointer_grab) {
 		GdkDrawable *drawable = GDK_DRAWABLE(widget->window);
@@ -334,7 +334,7 @@ static gboolean motion_event(GtkWidget *
 			gdk_display_warp_pointer(display, screen, x, y);
 			priv->last_x = -1;
 			priv->last_y = -1;
-			return TRUE;
+			return FALSE;
 		}
 	}
 
@@ -353,7 +353,7 @@ static gboolean motion_event(GtkWidget *
 	priv->last_x = (int)motion->x;
 	priv->last_y = (int)motion->y;
 
-	return TRUE;
+	return FALSE;
 }
 
 static gboolean key_event(GtkWidget *widget, GdkEventKey *key,


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