[gtk+/multitouch: 43/48] scrolledwindow: Add GdkDevice parameter to ::press-and-hold handler
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/multitouch: 43/48] scrolledwindow: Add GdkDevice parameter to ::press-and-hold handler
- Date: Wed, 2 Nov 2011 13:24:59 +0000 (UTC)
commit aabe9be4ffca041b720061aa6e72ab45fda08119
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Nov 1 12:42:15 2011 +0100
scrolledwindow: Add GdkDevice parameter to ::press-and-hold handler
gtk/gtkscrolledwindow.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index a55536b..410ba83 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -231,6 +231,7 @@ static gboolean gtk_scrolled_window_scroll_event (GtkWidget *widge
static gboolean gtk_scrolled_window_button_press_event (GtkWidget *widget,
GdkEvent *event);
static gboolean gtk_scrolled_window_press_and_hold (GtkWidget *widget,
+ GdkDevice *device,
GtkPressAndHoldAction action,
gint x,
gint y);
@@ -2818,6 +2819,7 @@ gtk_scrolled_window_start_deceleration (GtkScrolledWindow *scrolled_window,
static gboolean
gtk_scrolled_window_press_and_hold (GtkWidget *widget,
+ GdkDevice *device,
GtkPressAndHoldAction action,
gint x,
gint y)
@@ -2833,8 +2835,11 @@ gtk_scrolled_window_press_and_hold (GtkWidget *widget,
/* Cancel the scrolling and send the button press
* event to the child widget
*/
+ if (!priv->button_press_event ||
+ device != gdk_event_get_device (priv->button_press_event))
+ return FALSE;
- gdk_device_ungrab (gdk_event_get_device (priv->button_press_event), GDK_CURRENT_TIME);
+ gdk_device_ungrab (device, GDK_CURRENT_TIME);
if (priv->motion_notify_id > 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]