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

Side by Side Diff: ui/events/platform/x11/x11_event_source.cc

Issue 223483002: base: Do not allow MessagePumpObservers to consume events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r262009 Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/display/chromeos/x11/native_display_delegate_x11.cc ('k') | ui/gl/gl_surface_glx.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ui/events/platform/x11/x11_event_source.h" 5 #include "ui/events/platform/x11/x11_event_source.h"
6 6
7 #include <glib.h> 7 #include <glib.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/X.h> 9 #include <X11/X.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 uint32_t X11EventSource::DispatchEvent(XEvent* xevent) { 190 uint32_t X11EventSource::DispatchEvent(XEvent* xevent) {
191 bool have_cookie = false; 191 bool have_cookie = false;
192 if (xevent->type == GenericEvent && 192 if (xevent->type == GenericEvent &&
193 XGetEventData(xevent->xgeneric.display, &xevent->xcookie)) { 193 XGetEventData(xevent->xgeneric.display, &xevent->xcookie)) {
194 have_cookie = true; 194 have_cookie = true;
195 } 195 }
196 196
197 // TODO(sad): Remove this once all MessagePumpObservers are turned into 197 // TODO(sad): Remove this once all MessagePumpObservers are turned into
198 // PlatformEventObservers. 198 // PlatformEventObservers.
199 uint32_t action = ui::POST_DISPATCH_NONE; 199 base::MessagePumpX11::Current()->WillProcessXEvent(xevent);
200 if (!base::MessagePumpX11::Current()->WillProcessXEvent(xevent)) { 200 uint32_t action = PlatformEventSource::DispatchEvent(xevent);
201 action = PlatformEventSource::DispatchEvent(xevent); 201 base::MessagePumpX11::Current()->DidProcessXEvent(xevent);
202 base::MessagePumpX11::Current()->DidProcessXEvent(xevent);
203 }
204 202
205 if (have_cookie) 203 if (have_cookie)
206 XFreeEventData(xevent->xgeneric.display, &xevent->xcookie); 204 XFreeEventData(xevent->xgeneric.display, &xevent->xcookie);
207 return action; 205 return action;
208 } 206 }
209 207
210 scoped_ptr<PlatformEventSource> PlatformEventSource::CreateDefault() { 208 scoped_ptr<PlatformEventSource> PlatformEventSource::CreateDefault() {
211 return scoped_ptr<PlatformEventSource>( 209 return scoped_ptr<PlatformEventSource>(
212 new X11EventSource(gfx::GetXDisplay())); 210 new X11EventSource(gfx::GetXDisplay()));
213 } 211 }
214 212
215 } // namespace ui 213 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/chromeos/x11/native_display_delegate_x11.cc ('k') | ui/gl/gl_surface_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698