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

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

Issue 688253002: Implemented smooth scrolling using xinput2 in X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disabled coalescing for all scroll events Created 5 years 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 return action; 132 return action;
133 } 133 }
134 134
135 uint32_t X11EventSource::DispatchEvent(XEvent* xevent) { 135 uint32_t X11EventSource::DispatchEvent(XEvent* xevent) {
136 uint32_t action = PlatformEventSource::DispatchEvent(xevent); 136 uint32_t action = PlatformEventSource::DispatchEvent(xevent);
137 if (xevent->type == GenericEvent && 137 if (xevent->type == GenericEvent &&
138 xevent->xgeneric.evtype == XI_HierarchyChanged) { 138 xevent->xgeneric.evtype == XI_HierarchyChanged) {
139 ui::UpdateDeviceList(); 139 ui::UpdateDeviceList();
140 hotplug_event_handler_->OnHotplugEvent(); 140 hotplug_event_handler_->OnHotplugEvent();
141 } 141 }
142
143 if (xevent->type == EnterNotify &&
144 xevent->xcrossing.detail != NotifyInferior &&
145 xevent->xcrossing.mode != NotifyUngrab) {
146 // Clear stored scroll data
147 ui::DeviceDataManagerX11::GetInstance()->InvalidateScrollClasses();
148 }
142 return action; 149 return action;
143 } 150 }
144 151
145 void X11EventSource::StopCurrentEventStream() { 152 void X11EventSource::StopCurrentEventStream() {
146 continue_stream_ = false; 153 continue_stream_ = false;
147 } 154 }
148 155
149 void X11EventSource::OnDispatcherListChanged() { 156 void X11EventSource::OnDispatcherListChanged() {
150 if (!hotplug_event_handler_) { 157 if (!hotplug_event_handler_) {
151 hotplug_event_handler_.reset(new X11HotplugEventHandler()); 158 hotplug_event_handler_.reset(new X11HotplugEventHandler());
152 // Force the initial device query to have an update list of active devices. 159 // Force the initial device query to have an update list of active devices.
153 hotplug_event_handler_->OnHotplugEvent(); 160 hotplug_event_handler_->OnHotplugEvent();
154 } 161 }
155 } 162 }
156 163
157 } // namespace ui 164 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698