From 522c572075010f04c94fe8b7773bf40d0928a2ff Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 30 Jun 2023 16:20:02 +0800 Subject: [PATCH] * src/android.c (android_query_tree): Correctly return children. --- src/android.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/android.c b/src/android.c index da5e8da3be1..2a2d134c3c8 100644 --- a/src/android.c +++ b/src/android.c @@ -5631,7 +5631,9 @@ android_query_tree (android_window handle, android_window *root_return, android_exception_check_nonnull (shorts, array); for (i = 1; i < nelements; ++i) - children[i] = shorts[i]; + /* Subtract one from the index into children, since the parent is + not included. */ + children[i - 1] = shorts[i]; /* Finally, return the parent and other values. */ *root_return = 0; -- 2.39.2