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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/base/x/x11_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_X_X11_UTIL_H_ 5 #ifndef UI_BASE_X_X11_UTIL_H_
6 #define UI_BASE_X_X11_UTIL_H_ 6 #define UI_BASE_X_X11_UTIL_H_
7 7
8 // This file declares utility functions for X11 (Linux only). 8 // This file declares utility functions for X11 (Linux only).
9 // 9 //
10 // These functions do not require the Xlib headers to be included (which is why 10 // These functions do not require the Xlib headers to be included (which is why
(...skipping 11 matching lines...) Expand all
22 #include "ui/events/keycodes/keyboard_codes.h" 22 #include "ui/events/keycodes/keyboard_codes.h"
23 #include "ui/gfx/point.h" 23 #include "ui/gfx/point.h"
24 #include "ui/gfx/x/x11_types.h" 24 #include "ui/gfx/x/x11_types.h"
25 25
26 typedef unsigned long Atom; 26 typedef unsigned long Atom;
27 typedef unsigned long XSharedMemoryId; // ShmSeg in the X headers. 27 typedef unsigned long XSharedMemoryId; // ShmSeg in the X headers.
28 typedef unsigned long Cursor; 28 typedef unsigned long Cursor;
29 typedef struct _XcursorImage XcursorImage; 29 typedef struct _XcursorImage XcursorImage;
30 typedef union _XEvent XEvent; 30 typedef union _XEvent XEvent;
31 31
32 // A process wide singleton cache for X menus.
33 template <typename T> struct DefaultSingletonTraits;
34
32 #if defined(TOOLKIT_GTK) 35 #if defined(TOOLKIT_GTK)
33 typedef struct _GdkDrawable GdkWindow; 36 typedef struct _GdkDrawable GdkWindow;
34 typedef struct _GtkWidget GtkWidget; 37 typedef struct _GtkWidget GtkWidget;
35 typedef struct _GtkWindow GtkWindow; 38 typedef struct _GtkWindow GtkWindow;
36 #endif 39 #endif
37 40
38 namespace gfx { 41 namespace gfx {
39 class Canvas; 42 class Canvas;
40 class Point; 43 class Point;
41 class Rect; 44 class Rect;
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 ::Cursor get() const; 394 ::Cursor get() const;
392 void reset(::Cursor cursor); 395 void reset(::Cursor cursor);
393 396
394 private: 397 private:
395 ::Cursor cursor_; 398 ::Cursor cursor_;
396 XDisplay* display_; 399 XDisplay* display_;
397 400
398 DISALLOW_COPY_AND_ASSIGN(XScopedCursor); 401 DISALLOW_COPY_AND_ASSIGN(XScopedCursor);
399 }; 402 };
400 403
404 // 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
405 class UI_BASE_EXPORT XMenuList {
406 public:
407 static XMenuList* GetInstance();
408
409 // Checks if |menu| has _NET_WM_WINDOW_TYPE property set to
410 // "_NET_WM_WINDOW_TYPE_MENU" atom and if so caches it.
411 void MaybeRegisterMenu(XID menu);
412
413 // Finds |menu| in cache and if found removes it.
414 void MaybeUnregisterMenu(XID menu);
415
416 // Inserts cached menu XIDs at the beginning of |stack|.
417 void InsertMenuWindowXIDs(std::vector<XID>* stack);
418
419 private:
420 friend struct DefaultSingletonTraits<XMenuList>;
421 XMenuList();
422 ~XMenuList();
423
424 std::vector<XID> menus_;
425 ::Atom menu_type_atom_;
426 DISALLOW_COPY_AND_ASSIGN(XMenuList);
427 };
428
401 } // namespace ui 429 } // namespace ui
402 430
403 #endif // UI_BASE_X_X11_UTIL_H_ 431 #endif // UI_BASE_X_X11_UTIL_H_
OLDNEW
« 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