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

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

Issue 2055913002: Revert "Fixed first step of scrolling not applying" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | no next file » | 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 <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/XKBlib.h> 8 #include <X11/XKBlib.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 10
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 delegate_->ProcessXEvent(xevent); 204 delegate_->ProcessXEvent(xevent);
205 PostDispatchEvent(xevent); 205 PostDispatchEvent(xevent);
206 if (have_cookie) 206 if (have_cookie)
207 XFreeEventData(xevent->xgeneric.display, &xevent->xcookie); 207 XFreeEventData(xevent->xgeneric.display, &xevent->xcookie);
208 } 208 }
209 209
210 void X11EventSource::PostDispatchEvent(XEvent* xevent) { 210 void X11EventSource::PostDispatchEvent(XEvent* xevent) {
211 if (xevent->type == GenericEvent && 211 if (xevent->type == GenericEvent &&
212 (xevent->xgeneric.evtype == XI_HierarchyChanged || 212 (xevent->xgeneric.evtype == XI_HierarchyChanged ||
213 (xevent->xgeneric.evtype == XI_DeviceChanged && 213 xevent->xgeneric.evtype == XI_DeviceChanged)) {
214 static_cast<XIDeviceChangedEvent*>(xevent->xcookie.data)->reason ==
215 XIDeviceChange))) {
216 UpdateDeviceList(); 214 UpdateDeviceList();
217 hotplug_event_handler_->OnHotplugEvent(); 215 hotplug_event_handler_->OnHotplugEvent();
218 } 216 }
219 217
220 if (xevent->type == EnterNotify && 218 if (xevent->type == EnterNotify &&
221 xevent->xcrossing.detail != NotifyInferior && 219 xevent->xcrossing.detail != NotifyInferior &&
222 xevent->xcrossing.mode != NotifyUngrab) { 220 xevent->xcrossing.mode != NotifyUngrab) {
223 // Clear stored scroll data 221 // Clear stored scroll data
224 ui::DeviceDataManagerX11::GetInstance()->InvalidateScrollClasses(); 222 ui::DeviceDataManagerX11::GetInstance()->InvalidateScrollClasses();
225 } 223 }
226 } 224 }
227 225
228 void X11EventSource::StopCurrentEventStream() { 226 void X11EventSource::StopCurrentEventStream() {
229 continue_stream_ = false; 227 continue_stream_ = false;
230 } 228 }
231 229
232 void X11EventSource::OnDispatcherListChanged() { 230 void X11EventSource::OnDispatcherListChanged() {
233 if (!hotplug_event_handler_) { 231 if (!hotplug_event_handler_) {
234 hotplug_event_handler_.reset(new X11HotplugEventHandler()); 232 hotplug_event_handler_.reset(new X11HotplugEventHandler());
235 // Force the initial device query to have an update list of active devices. 233 // Force the initial device query to have an update list of active devices.
236 hotplug_event_handler_->OnHotplugEvent(); 234 hotplug_event_handler_->OnHotplugEvent();
237 } 235 }
238 } 236 }
239 237
240 } // namespace ui 238 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698