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
Window: fix issue with multi Activity support
each Activity has its own Window object. Therefore the check if the contentView has changed needs to be in the common native window
This commit is contained in:
@@ -7,7 +7,11 @@
|
||||
|
||||
JNIEXPORT void JNICALL Java_android_view_Window_set_1widget_1as_1root(JNIEnv *env, jobject this, jlong window, jlong widget)
|
||||
{
|
||||
gtk_window_set_child(GTK_WINDOW(_PTR(window)), gtk_widget_get_parent(GTK_WIDGET(_PTR(widget))));
|
||||
GtkWindow *gtk_window = GTK_WINDOW(_PTR(window));
|
||||
GtkWidget *gtk_widget = gtk_widget_get_parent(GTK_WIDGET(_PTR(widget)));
|
||||
if (gtk_widget != gtk_window_get_child(gtk_window)) {
|
||||
gtk_window_set_child(gtk_window, gtk_widget);
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME put this in a header file
|
||||
|
||||
@@ -41,11 +41,9 @@ public class Window {
|
||||
}
|
||||
|
||||
public void setContentView(View view) {
|
||||
if (view != contentView) {
|
||||
contentView = view;
|
||||
view.onAttachedToWindow();
|
||||
set_widget_as_root(native_window, view.widget);
|
||||
}
|
||||
contentView = view;
|
||||
view.onAttachedToWindow();
|
||||
set_widget_as_root(native_window, view.widget);
|
||||
}
|
||||
|
||||
public View getDecorView() {
|
||||
|
||||
Reference in New Issue
Block a user