diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-02-13 15:16:02 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-02-13 16:14:05 +0000 |
commit | c83a47cc4ca92bee460699590f721fe046604206 (patch) | |
tree | e164248638cf7249b3b2ad87c93b57aeed57017f | |
parent | b0bb02889e4df138c0b9e96e913bd95e7ab62524 (diff) |
Fix build with use_glib=false and use_x11=true
Fix what appears to be bitrot in the libevent implementation of XEvent
handling so that it works in X11 builds.
Change-Id: Ie348c57a263a2360e623f28c06ebdbf501681749
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r-- | chromium/ui/events/BUILD.gn | 9 | ||||
-rw-r--r-- | chromium/ui/events/platform/x11/x11_event_source_libevent.cc | 11 |
2 files changed, 16 insertions, 4 deletions
diff --git a/chromium/ui/events/BUILD.gn b/chromium/ui/events/BUILD.gn index effeeb8b211..71185e9fb2b 100644 --- a/chromium/ui/events/BUILD.gn +++ b/chromium/ui/events/BUILD.gn @@ -145,10 +145,7 @@ component("events") { if (use_x11) { sources += [ "x/events_x.cc" ] - configs += [ - "//build/config/linux:glib", - "//build/config/linux:x11", - ] + configs += [ "//build/config/linux:x11" ] deps += [ "//ui/events/devices", "//ui/events/devices/x11", @@ -157,6 +154,10 @@ component("events") { ] } + if (use_glib) { + configs += [ "//build/config/linux:glib" ] + } + if (use_ozone || (is_android && use_aura)) { sources += [ "events_default.cc" ] } diff --git a/chromium/ui/events/platform/x11/x11_event_source_libevent.cc b/chromium/ui/events/platform/x11/x11_event_source_libevent.cc index 87f990c57f2..fdb4ea79ebe 100644 --- a/chromium/ui/events/platform/x11/x11_event_source_libevent.cc +++ b/chromium/ui/events/platform/x11/x11_event_source_libevent.cc @@ -154,6 +154,10 @@ void X11EventSourceLibevent::RemoveXEventDispatcher( } void X11EventSourceLibevent::ProcessXEvent(XEvent* xevent) { +#if defined(USE_X11) + // DispatchEvent takes ui::PlatformEvent which is XEvent* + DispatchEvent(xevent); +#else std::unique_ptr<ui::Event> translated_event = TranslateXEventToEvent(*xevent); if (translated_event) { DispatchEvent(translated_event.get()); @@ -162,6 +166,7 @@ void X11EventSourceLibevent::ProcessXEvent(XEvent* xevent) { // directly to XEventDispatchers. DispatchXEventToXEventDispatchers(xevent); } +#endif } void X11EventSourceLibevent::AddEventWatcher() { @@ -204,4 +209,10 @@ void X11EventSourceLibevent::OnFileCanWriteWithoutBlocking(int fd) { NOTREACHED(); } +#if defined(USE_X11) +std::unique_ptr<PlatformEventSource> PlatformEventSource::CreateDefault() { + return base::MakeUnique<X11EventSourceLibevent>(gfx::GetXDisplay()); +} +#endif + } // namespace ui |