ximagesink: fix mouse pointer offsets in navigation event if window is smaller than...
authorHannes Bistry <hannesb@gmx.net>
Tue, 14 Apr 2009 11:10:30 +0000 (12:10 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 14 Apr 2009 11:26:10 +0000 (12:26 +0100)
Fixes #570768.

sys/ximage/ximagesink.c

index 9dec0cd..e2d73fc 100644 (file)
@@ -1852,11 +1852,11 @@ gst_ximagesink_navigation_send_event (GstNavigation * navigation,
 
   g_mutex_unlock (ximagesink->flow_lock);
 
-  if (gst_structure_get_double (structure, "pointer_x", &x)) {
+  if (x_offset > 0 && gst_structure_get_double (structure, "pointer_x", &x)) {
     x -= x_offset / 2;
     gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, x, NULL);
   }
-  if (gst_structure_get_double (structure, "pointer_y", &y)) {
+  if (y_offset > 0 && gst_structure_get_double (structure, "pointer_y", &y)) {
     y -= y_offset / 2;
     gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, y, NULL);
   }