blob: 06f1736232d2ba1eb13862d0725b8676be61ba31 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
diff --git a/ui/platform_window/x11/x11_topmost_window_finder.cc b/ui/platform_window/x11/x11_topmost_window_finder.cc
index e20bf0abf..c9c672c60 100644
--- a/ui/platform_window/x11/x11_topmost_window_finder.cc
+++ b/ui/platform_window/x11/x11_topmost_window_finder.cc
@@ -42,12 +42,12 @@ bool EnumerateChildren(ShouldStopIteratingCallback should_stop_iterating,
// reverse-iterate the list to check the windows from top-to-bottom.
std::vector<x11::Window>::reverse_iterator iter;
for (iter = windows.rbegin(); iter != windows.rend(); iter++) {
- if (IsWindowNamed(*iter) && should_stop_iterating.Run(*iter))
- return true;
if (depth < max_depth) {
if (EnumerateChildren(should_stop_iterating, *iter, max_depth, depth + 1))
return true;
}
+ if (IsWindowNamed(*iter) && should_stop_iterating.Run(*iter))
+ return true;
}
return false;
|