Commit d63ab36d authored by Sebastian Ramacher's avatar Sebastian Ramacher

Abuse event.x and event.y to store scroll deltas

argument->data is reserved for user data.
Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent e051496b
......@@ -321,8 +321,6 @@ girara_callback_view_scroll_event(GtkWidget* UNUSED(widget), GdkEventScroll* scr
event.x = scroll->x;
event.y = scroll->y;
double motion_direction[2];
switch (scroll->direction) {
case GDK_SCROLL_UP:
event.type = GIRARA_EVENT_SCROLL_UP;
......@@ -338,7 +336,8 @@ girara_callback_view_scroll_event(GtkWidget* UNUSED(widget), GdkEventScroll* scr
break;
case GDK_SCROLL_SMOOTH:
event.type = GIRARA_EVENT_SCROLL_BIDIRECTIONAL;
gdk_event_get_scroll_deltas((GdkEvent*)scroll, motion_direction, motion_direction + 1);
/* We abuse x and y here. We really need more fields in girara_event_t. */
gdk_event_get_scroll_deltas((GdkEvent*)scroll, &event.x, &event.y);
break;
default:
return false;
......@@ -354,7 +353,6 @@ girara_callback_view_scroll_event(GtkWidget* UNUSED(widget), GdkEventScroll* scr
&& mouse_event->event_type == event.type
&& (session->modes.current_mode == mouse_event->mode || mouse_event->mode == 0)
) {
mouse_event->argument.data = motion_direction;
mouse_event->function(session, &(mouse_event->argument), &event, session->buffer.n);
girara_list_iterator_free(iter);
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment