You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
Revert "View: call onLayout() only on size change or on request"
This reverts commit b33a470c7b.
This commit was added as fix for layout recreation loops, but this is no
longer a problem, since ViewGroup.detachViewFromParent() has been
improved. The first fix is no longer needed and it seems to cause some
minor regressions, so we revert it.
This commit is contained in:
@@ -134,7 +134,7 @@ void set_up_handle_cache(JNIEnv *env)
|
||||
handle_cache.view.onTouchEvent = _METHOD(handle_cache.view.class, "onTouchEvent", "(Landroid/view/MotionEvent;)Z");
|
||||
handle_cache.view.dispatchTouchEvent = _METHOD(handle_cache.view.class, "dispatchTouchEvent", "(Landroid/view/MotionEvent;)Z");
|
||||
handle_cache.view.onInterceptTouchEvent = _METHOD(handle_cache.view.class, "onInterceptTouchEvent", "(Landroid/view/MotionEvent;)Z");
|
||||
handle_cache.view.layoutInternal = _METHOD(handle_cache.view.class, "layoutInternal", "(II)Z");
|
||||
handle_cache.view.layoutInternal = _METHOD(handle_cache.view.class, "layoutInternal", "(II)V");
|
||||
handle_cache.view.measure = _METHOD(handle_cache.view.class, "measure", "(II)V");
|
||||
handle_cache.view.performLongClick = _METHOD(handle_cache.view.class, "performLongClick", "(FF)Z");
|
||||
handle_cache.view.getId = _METHOD(handle_cache.view.class, "getId", "()I");
|
||||
|
||||
@@ -70,18 +70,9 @@ static void android_layout_allocate(GtkLayoutManager *layout_manager, GtkWidget
|
||||
height = layout->real_height;
|
||||
}
|
||||
|
||||
jboolean layoutChanged = (*env)->CallBooleanMethod(env, layout->view, handle_cache.view.layoutInternal, width, height);
|
||||
(*env)->CallVoidMethod(env, layout->view, handle_cache.view.layoutInternal, width, height);
|
||||
if((*env)->ExceptionCheck(env))
|
||||
(*env)->ExceptionDescribe(env);
|
||||
if (!layoutChanged) { // No change in layout. Reapply the current allocations
|
||||
for (GtkWidget *child = gtk_widget_get_first_child(widget); child; child = gtk_widget_get_next_sibling(child)) {
|
||||
graphene_matrix_t transform_matrix;
|
||||
if (gtk_widget_compute_transform(child, widget, &transform_matrix)) {
|
||||
GskTransform *transform = gsk_transform_matrix(NULL, &transform_matrix);
|
||||
gtk_widget_allocate(child, gtk_widget_get_width(child), gtk_widget_get_height(child), gtk_widget_get_baseline(child), transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GtkSizeRequestMode android_layout_get_request_mode(GtkLayoutManager *layout_manager, GtkWidget *widget)
|
||||
|
||||
Reference in New Issue
Block a user