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

Unified Diff: ui/events/platform/x11/x11_event_source.cc

Issue 508303002: Move touchscreen device caching to DeviceDataManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/events/platform/x11/x11_event_source.cc
diff --git a/ui/events/platform/x11/x11_event_source.cc b/ui/events/platform/x11/x11_event_source.cc
index 20237dd32f13cce005a8a48f1123ad22b1c852c6..b2f5dfac6f7b81a243bd5ddfb77d58d46e48fbd0 100644
--- a/ui/events/platform/x11/x11_event_source.cc
+++ b/ui/events/platform/x11/x11_event_source.cc
@@ -13,6 +13,7 @@
#include "ui/events/event_utils.h"
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/events/x/device_data_manager_x11.h"
+#include "ui/events/x/hotplug_event_handler_x11.h"
#include "ui/gfx/x/x11_types.h"
namespace ui {
@@ -85,8 +86,13 @@ X11EventSource::X11EventSource(XDisplay* display)
continue_stream_(true) {
CHECK(display_);
DeviceDataManagerX11::CreateInstance();
+ hotplug_event_handler_.reset(
+ new HotplugEventHandlerX11(DeviceDataManager::GetInstance()));
InitializeXInput2(display_);
InitializeXkb(display_);
+
+ // Force the initial device query to have an update list of active devices.
+ hotplug_event_handler_->OnHotplugEvent();
}
X11EventSource::~X11EventSource() {
@@ -137,6 +143,7 @@ uint32_t X11EventSource::DispatchEvent(XEvent* xevent) {
if (xevent->type == GenericEvent &&
xevent->xgeneric.evtype == XI_HierarchyChanged) {
ui::UpdateDeviceList();
+ hotplug_event_handler_->OnHotplugEvent();
}
if (have_cookie)

Powered by Google App Engine
This is Rietveld 408576698