#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/x/device_data_manager_x11.h"
+#include "ui/events/platform/x11/x11_hotplug_event_handler.h"
#include "ui/gfx/x/x11_types.h"
namespace ui {
continue_stream_(true) {
CHECK(display_);
DeviceDataManagerX11::CreateInstance();
+ hotplug_event_handler_.reset(
+ new X11HotplugEventHandler(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() {
if (xevent->type == GenericEvent &&
xevent->xgeneric.evtype == XI_HierarchyChanged) {
ui::UpdateDeviceList();
+ hotplug_event_handler_->OnHotplugEvent();
}
if (have_cookie)