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

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

Issue 1287103004: Sync ui/events to chromium @ https://codereview.chromium.org/1210203002 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 4 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
« no previous file with comments | « ui/events/platform/x11/x11_event_source.h ('k') | ui/events/platform/x11/x11_event_source_libevent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6688d6146fb3c5d66e5db9ef8c091fc5cacefea9..5101f2703a3bff44f677e1c64db1a2ec09532980 100644
--- a/ui/events/platform/x11/x11_event_source.cc
+++ b/ui/events/platform/x11/x11_event_source.cc
@@ -6,14 +6,14 @@
#include <X11/extensions/XInput2.h>
#include <X11/X.h>
-#include <X11/XKBlib.h>
#include <X11/Xlib.h>
+#include <X11/XKBlib.h>
#include "base/logging.h"
+#include "ui/events/devices/x11/device_data_manager_x11.h"
+#include "ui/events/event_utils.h"
#include "ui/events/platform/platform_event_dispatcher.h"
-#include "ui/events/platform/platform_event_utils.h"
-#include "ui/events/platform/x11/device_data_manager_x11.h"
-#include "ui/events/platform/x11/hotplug_event_handler_x11.h"
+#include "ui/events/platform/x11/x11_hotplug_event_handler.h"
#include "ui/gfx/x/x11_types.h"
namespace ui {
@@ -35,23 +35,16 @@ bool InitializeXInput2(XDisplay* display) {
}
g_xinput_opcode = xiopcode;
-#if defined(USE_XI2_MT)
- // USE_XI2_MT also defines the required XI2 minor minimum version.
- int major = 2, minor = USE_XI2_MT;
-#else
- int major = 2, minor = 0;
-#endif
+ int major = 2, minor = 2;
if (XIQueryVersion(display, &major, &minor) == BadRequest) {
DVLOG(1) << "XInput2 not supported in the server.";
return false;
}
-#if defined(USE_XI2_MT)
- if (major < 2 || (major == 2 && minor < USE_XI2_MT)) {
+ if (major < 2 || (major == 2 && minor < 2)) {
DVLOG(1) << "XI version on server is " << major << "." << minor << ". "
- << "But 2." << USE_XI2_MT << " is required.";
+ << "But 2.2 is required.";
return false;
}
-#endif
return true;
}
@@ -86,13 +79,8 @@ 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() {
@@ -155,4 +143,12 @@ void X11EventSource::StopCurrentEventStream() {
continue_stream_ = false;
}
+void X11EventSource::OnDispatcherListChanged() {
+ if (!hotplug_event_handler_) {
+ hotplug_event_handler_.reset(new X11HotplugEventHandler());
+ // Force the initial device query to have an update list of active devices.
+ hotplug_event_handler_->OnHotplugEvent();
+ }
+}
+
} // namespace ui
« no previous file with comments | « ui/events/platform/x11/x11_event_source.h ('k') | ui/events/platform/x11/x11_event_source_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698