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

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

Issue 1324913002: Fix out of order key events in Chrome on Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix component build Created 5 years, 3 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
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 <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/X.h> 8 #include <X11/X.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #include <X11/XKBlib.h> 10 #include <X11/XKBlib.h>
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // It may be useful to eventually align this event dispatch with vsync, but 100 // It may be useful to eventually align this event dispatch with vsync, but
101 // not yet. 101 // not yet.
102 continue_stream_ = true; 102 continue_stream_ = true;
103 while (XPending(display_) && continue_stream_) { 103 while (XPending(display_) && continue_stream_) {
104 XEvent xevent; 104 XEvent xevent;
105 XNextEvent(display_, &xevent); 105 XNextEvent(display_, &xevent);
106 ExtractCookieDataDispatchEvent(&xevent); 106 ExtractCookieDataDispatchEvent(&xevent);
107 } 107 }
108 } 108 }
109 109
110 void X11EventSource::DispatchEventNow(XEvent* event) {
111 ExtractCookieDataDispatchEvent(event);
112 }
113
110 void X11EventSource::BlockUntilWindowMapped(XID window) { 114 void X11EventSource::BlockUntilWindowMapped(XID window) {
111 XEvent event; 115 XEvent event;
112 do { 116 do {
113 // Block until there's a message of |event_mask| type on |w|. Then remove 117 // Block until there's a message of |event_mask| type on |w|. Then remove
114 // it from the queue and stuff it in |event|. 118 // it from the queue and stuff it in |event|.
115 XWindowEvent(display_, window, StructureNotifyMask, &event); 119 XWindowEvent(display_, window, StructureNotifyMask, &event);
116 ExtractCookieDataDispatchEvent(&event); 120 ExtractCookieDataDispatchEvent(&event);
117 } while (event.type != MapNotify); 121 } while (event.type != MapNotify);
118 } 122 }
119 123
(...skipping 28 matching lines...) Expand all
148 152
149 void X11EventSource::OnDispatcherListChanged() { 153 void X11EventSource::OnDispatcherListChanged() {
150 if (!hotplug_event_handler_) { 154 if (!hotplug_event_handler_) {
151 hotplug_event_handler_.reset(new X11HotplugEventHandler()); 155 hotplug_event_handler_.reset(new X11HotplugEventHandler());
152 // Force the initial device query to have an update list of active devices. 156 // Force the initial device query to have an update list of active devices.
153 hotplug_event_handler_->OnHotplugEvent(); 157 hotplug_event_handler_->OnHotplugEvent();
154 } 158 }
155 } 159 }
156 160
157 } // namespace ui 161 } // namespace ui
OLDNEW
« chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc ('K') | « ui/events/platform/x11/x11_event_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698