From 0ebbfc94616d1cd6b36cb510e5c6506513797dbf Mon Sep 17 00:00:00 2001 From: Julian Winkler Date: Sat, 11 May 2024 13:17:54 +0200 Subject: [PATCH] set GTK_OVERFLOW_HIDDEN again for WrapperWidgets with allocation This is needed for RecyclerView, which will be allocated because of the onTouch() listener. --- src/api-impl-jni/views/android_view_View.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/api-impl-jni/views/android_view_View.c b/src/api-impl-jni/views/android_view_View.c index 7621a849..74363d0e 100644 --- a/src/api-impl-jni/views/android_view_View.c +++ b/src/api-impl-jni/views/android_view_View.c @@ -185,6 +185,7 @@ void _setOnTouchListener(JNIEnv *env, jobject this, GtkWidget *widget, jobject o if (!wrapper->needs_allocation && (wrapper->layout_width || wrapper->layout_height)) gtk_widget_size_allocate(GTK_WIDGET(wrapper), &(GtkAllocation){.x = 0, .y = 0, .width = wrapper->layout_width, .height = wrapper->layout_height}, 0); wrapper->needs_allocation = true; + gtk_widget_set_overflow(GTK_WIDGET(wrapper), GTK_OVERFLOW_HIDDEN); } JNIEXPORT void JNICALL Java_android_view_View_setOnTouchListener(JNIEnv *env, jobject this, jobject on_touch_listener) @@ -371,9 +372,6 @@ JNIEXPORT jlong JNICALL Java_android_view_View_native_1constructor(JNIEnv *env, gtk_widget_set_name(widget, name); (*env)->ReleaseStringUTFChars(env, nameObj, name); - /* this should better match default android behavior */ - gtk_widget_set_overflow(wrapper, GTK_OVERFLOW_VISIBLE); - if (_METHOD(_CLASS(this), "onGenericMotionEvent", "(Landroid/view/MotionEvent;)Z") != handle_cache.view.onGenericMotionEvent) { GtkEventController *controller = gtk_event_controller_scroll_new(GTK_EVENT_CONTROLLER_SCROLL_VERTICAL);