[totem] backend: Don't pass an event to translate_coords()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] backend: Don't pass an event to translate_coords()
- Date: Mon, 3 Feb 2014 15:26:06 +0000 (UTC)
commit 4fb45069e40a087f94a7a80aa341925eda201f76
Author: Bastien Nocera <hadess hadess net>
Date: Mon Feb 3 16:22:57 2014 +0100
backend: Don't pass an event to translate_coords()
As we might want it to handle different types of events.
src/backend/bacon-video-widget.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index b13445b..c777f4b 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -728,19 +728,21 @@ toggle_controls (BaconVideoWidget *bvw)
}
static void
-translate_coords (GtkWidget *widget,
- GdkEventButton *event,
- int *x,
- int *y)
+translate_coords (GtkWidget *widget,
+ GdkWindow *window,
+ int x,
+ int y,
+ int *out_x,
+ int *out_y)
{
GtkWidget *src;
- gdk_window_get_user_data (event->window, (gpointer *)&src);
+ gdk_window_get_user_data (window, (gpointer *)&src);
if (src && src != widget) {
- gtk_widget_translate_coordinates (src, widget, event->x, event->y, x, y);
+ gtk_widget_translate_coordinates (src, widget, x, y, out_x, out_y);
} else {
- *x = event->x;
- *y = event->y;
+ *out_x = x;
+ *out_y = y;
}
}
@@ -769,7 +771,7 @@ bacon_video_widget_button_press_or_release (GtkWidget *widget, GdkEventButton *e
g_return_val_if_fail (bvw->priv->play != NULL, FALSE);
- translate_coords (widget, event, &x, &y);
+ translate_coords (widget, event->window, event->x, event->y, &x, &y);
if (ignore_event (bvw, x, y))
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]