OnTouchListener: attach event controllers to WrapperWidget

otherwise, the touch event positions would depend on the scroll offset.
This fixes the glitchy vertical scrolling in ViewPager
This commit is contained in:
Julian Winkler
2024-03-25 19:50:29 +01:00
parent 2879e03120
commit e477b56dec
2 changed files with 2 additions and 3 deletions

View File

@@ -171,7 +171,7 @@ void _setOnTouchListener(JNIEnv *env, jobject this, GtkWidget *widget, jobject o
JNIEXPORT void JNICALL Java_android_view_View_setOnTouchListener(JNIEnv *env, jobject this, jobject on_touch_listener)
{
GtkWidget *widget = GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget")));
GtkWidget *widget = gtk_widget_get_parent(GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget"))));
_setOnTouchListener(env, this, widget, on_touch_listener);
}