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

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

Issue 8585015: Implement ui_controls for aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comments 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/aura/desktop_host_win.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/events_x.cc
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc
index cf2499ead1c88b33ab83357a33ceb20a64bda57a..dffd32944461181b6f012ab8059598858145d5fb 100644
--- a/ui/base/x/events_x.cc
+++ b/ui/base/x/events_x.cc
@@ -12,6 +12,10 @@
#include "ui/base/touch/touch_factory.h"
#include "ui/gfx/point.h"
+#if !defined(TOOLKIT_USES_GTK)
+#include "base/message_pump_x.h"
+#endif
+
namespace {
// Scroll amount for each wheelscroll event. 53 is also the value used for GTK+.
@@ -371,12 +375,24 @@ float GetTouchForce(const base::NativeEvent& native_event) {
}
base::NativeEvent CreateNoopEvent() {
- static XEvent* noop = new XEvent();
- noop->xclient.type = ClientMessage;
- noop->xclient.display = NULL;
- noop->xclient.window = None;
- noop->xclient.message_type = 0;
- noop->xclient.format = 0;
+ static XEvent* noop = NULL;
+ if (!noop) {
+ noop = new XEvent();
Daniel Erat 2011/11/22 01:46:14 i don't think there's any non-default constructor
oshima 2011/11/22 03:02:09 C++ supposed to be able to initialize POD types in
+ noop->xclient.type = ClientMessage;
+ noop->xclient.window = None;
Daniel Erat 2011/11/22 01:46:14 None == 0
oshima 2011/11/22 03:02:09 Hmm, it's implementation details and I think we sh
+ noop->xclient.format = 8;
+ DCHECK(!noop->xclient.display);
+ }
+ // TODO(oshima): Remove ifdef once gtk is removed from views.
+#if defined(TOOLKIT_USES_GTK)
+ NOTREACHED();
+#else
+ // Make sure we use atom from current xdisplay, which may
+ // change during the test.
+ noop->xclient.message_type = XInternAtom(
+ base::MessagePumpX::GetDefaultXDisplay(),
+ "noop", False);
+#endif
return noop;
}
« no previous file with comments | « ui/aura/desktop_host_win.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698