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

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

Issue 196213004: Allows menu host windows to be enumerated in DragTargetWindowFinder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds menus to the lsit of top level windows returned by EnumerateTopLevelWindows (including other p… Created 6 years, 9 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 | « no previous file | ui/base/x/x11_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/x11_util.h
diff --git a/ui/base/x/x11_util.h b/ui/base/x/x11_util.h
index dbcd987b9dd2984ac7b746302477c332c1602aeb..f38df6b0f790d70e1b3b7e857447d87783ea87ac 100644
--- a/ui/base/x/x11_util.h
+++ b/ui/base/x/x11_util.h
@@ -29,6 +29,9 @@ typedef unsigned long Cursor;
typedef struct _XcursorImage XcursorImage;
typedef union _XEvent XEvent;
+// A process wide singleton cache for X menus.
+template <typename T> struct DefaultSingletonTraits;
+
#if defined(TOOLKIT_GTK)
typedef struct _GdkDrawable GdkWindow;
typedef struct _GtkWidget GtkWidget;
@@ -398,6 +401,31 @@ class UI_BASE_EXPORT XScopedCursor {
DISALLOW_COPY_AND_ASSIGN(XScopedCursor);
};
+// Keeps track of created and destroyed top level menu windows.
sadrul 2014/03/22 17:55:18 I was more hoping we would create a list of all to
+class UI_BASE_EXPORT XMenuList {
+ public:
+ static XMenuList* GetInstance();
+
+ // Checks if |menu| has _NET_WM_WINDOW_TYPE property set to
+ // "_NET_WM_WINDOW_TYPE_MENU" atom and if so caches it.
+ void MaybeRegisterMenu(XID menu);
+
+ // Finds |menu| in cache and if found removes it.
+ void MaybeUnregisterMenu(XID menu);
+
+ // Inserts cached menu XIDs at the beginning of |stack|.
+ void InsertMenuWindowXIDs(std::vector<XID>* stack);
+
+ private:
+ friend struct DefaultSingletonTraits<XMenuList>;
+ XMenuList();
+ ~XMenuList();
+
+ std::vector<XID> menus_;
+ ::Atom menu_type_atom_;
+ DISALLOW_COPY_AND_ASSIGN(XMenuList);
+};
+
} // namespace ui
#endif // UI_BASE_X_X11_UTIL_H_
« no previous file with comments | « no previous file | ui/base/x/x11_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698