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

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

Issue 8387043: [Aura] Support always-on-top top level window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and update comment per ben Created 9 years, 1 month 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') | views/widget/native_widget_aura.cc » ('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 dada148842cccc876d9cd8eb38a760a3804c2be9..aa11de8a78e7a5cba96ea19f6ca46780dd5bf640 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -114,12 +114,7 @@ class XCursorCache {
public:
XCursorCache() {}
~XCursorCache() {
- Display* display = base::MessagePumpForUI::GetDefaultXDisplay();
- for (std::map<int, Cursor>::iterator it =
- cache_.begin(); it != cache_.end(); ++it) {
- XFreeCursor(display, it->second);
- }
- cache_.clear();
+ Clear();
}
Cursor GetCursor(int cursor_shape) {
@@ -134,6 +129,15 @@ class XCursorCache {
return it.first->second;
}
+ void Clear() {
+ Display* display = base::MessagePumpForUI::GetDefaultXDisplay();
+ for (std::map<int, Cursor>::iterator it =
+ cache_.begin(); it != cache_.end(); ++it) {
+ XFreeCursor(display, it->second);
+ }
+ cache_.clear();
+ }
+
private:
// Maps X11 font cursor shapes to Cursor IDs.
std::map<int, Cursor> cache_;
@@ -218,6 +222,12 @@ int GetDefaultScreen(Display* display) {
Cursor GetXCursor(int cursor_shape) {
CR_DEFINE_STATIC_LOCAL(XCursorCache, cache, ());
+
+ if (cursor_shape == kCursorClearXCursorCache) {
+ cache.Clear();
+ return 0;
+ }
+
return cache.GetCursor(cursor_shape);
}
« no previous file with comments | « ui/base/x/x11_util.h ('k') | views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698