[gtk+] spinbutton: Update to using GdkEvent API
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] spinbutton: Update to using GdkEvent API
- Date: Tue, 19 Sep 2017 17:14:19 +0000 (UTC)
commit e2eb20208b2ed9803f9eae4d51242d2455645f00
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Aug 25 16:55:22 2017 +0200
spinbutton: Update to using GdkEvent API
gtk/gtkspinbutton.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 8952465..11c514c 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -1115,14 +1115,18 @@ gtk_spin_button_scroll (GtkWidget *widget,
{
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
GtkSpinButtonPrivate *priv = spin->priv;
+ GdkScrollDirection direction;
- if (event->direction == GDK_SCROLL_UP)
+ if (!gdk_event_get_scroll_direction ((GdkEvent *) event, &direction))
+ return GDK_EVENT_PROPAGATE;
+
+ if (direction == GDK_SCROLL_UP)
{
if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
gtk_spin_button_real_spin (spin, gtk_adjustment_get_step_increment (priv->adjustment));
}
- else if (event->direction == GDK_SCROLL_DOWN)
+ else if (direction == GDK_SCROLL_DOWN)
{
if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]