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

Unified Diff: ui/events/x/touch_factory_x11.cc

Issue 52823002: x11: Move XInput2 availability information out of the message pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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
« no previous file with comments | « ui/events/x/touch_factory_x11.h ('k') | ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/touch_factory_x11.cc
diff --git a/ui/events/x/touch_factory_x11.cc b/ui/events/x/touch_factory_x11.cc
index 59fc8f162c829241cf1f8d9084b1557a790b6897..84066e3cb0b3391e690b7f21a47c82baddabfd3e 100644
--- a/ui/events/x/touch_factory_x11.cc
+++ b/ui/events/x/touch_factory_x11.cc
@@ -18,6 +18,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "ui/events/event_switches.h"
+#include "ui/events/x/device_data_manager.h"
#include "ui/events/x/device_list_cache_x.h"
#include "ui/gfx/x/x11_types.h"
@@ -29,10 +30,8 @@ TouchFactory::TouchFactory()
touch_events_disabled_(false),
touch_device_list_(),
id_generator_(0) {
-#if defined(USE_AURA)
- if (!base::MessagePumpForUI::HasXInput2())
+ if (!DeviceDataManager::GetInstance()->IsXInput2Available())
return;
-#endif
XDisplay* display = gfx::GetXDisplay();
UpdateDeviceList(display);
@@ -101,6 +100,9 @@ void TouchFactory::UpdateDeviceList(Display* display) {
}
#endif
+ if (!DeviceDataManager::GetInstance()->IsXInput2Available())
+ return;
+
// Instead of asking X for the list of devices all the time, let's maintain a
// list of pointer devices we care about.
// It should not be necessary to select for slave devices. XInput2 provides
« no previous file with comments | « ui/events/x/touch_factory_x11.h ('k') | ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698