Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1209)

Unified Diff: ui/base/x/x11_util.cc

Issue 10560014: Aura desktop: Fix tab dragging within a single chrome window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix filename so windows is excluded. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/x/x11_util.h ('k') | ui/views/widget/desktop_native_widget_helper_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/x11_util.cc
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index d0d0188bd8c1359de6585577b92e112a154b57fe..b058b2fe340b77e1e877279f21fc8c2077f4f360 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -769,6 +769,25 @@ bool EnumerateAllWindows(EnumerateWindowsDelegate* delegate, int max_depth) {
return EnumerateChildren(delegate, root, max_depth, 0);
}
+void EnumerateTopLevelWindows(ui::EnumerateWindowsDelegate* delegate) {
+ std::vector<XID> stack;
+ if (!ui::GetXWindowStack(ui::GetX11RootWindow(), &stack)) {
+ // Window Manager doesn't support _NET_CLIENT_LIST_STACKING, so fall back
+ // to old school enumeration of all X windows. Some WMs parent 'top-level'
+ // windows in unnamed actual top-level windows (ion WM), so extend the
+ // search depth to all children of top-level windows.
+ const int kMaxSearchDepth = 1;
+ ui::EnumerateAllWindows(delegate, kMaxSearchDepth);
+ return;
+ }
+
+ std::vector<XID>::iterator iter;
+ for (iter = stack.begin(); iter != stack.end(); iter++) {
+ if (delegate->ShouldStopIterating(*iter))
+ return;
+ }
+}
+
bool GetXWindowStack(Window window, std::vector<XID>* windows) {
windows->clear();
« no previous file with comments | « ui/base/x/x11_util.h ('k') | ui/views/widget/desktop_native_widget_helper_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698