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

Unified Diff: ui/platform_window/x11/x11_window_ozone.cc

Issue 1602173005: Add PlatformWindow/Event related code for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: XEventDispatcher added. Created 4 years, 11 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/platform_window/x11/x11_window_ozone.cc
diff --git a/ui/platform_window/x11/x11_window_ozone.cc b/ui/platform_window/x11/x11_window_ozone.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f73cb368db26697e524dc6fa3e56bfd44ee6b74a
--- /dev/null
+++ b/ui/platform_window/x11/x11_window_ozone.cc
@@ -0,0 +1,44 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/platform_window/x11/x11_window.h"
+
+#include <X11/extensions/XInput2.h>
+#include <X11/Xlib.h>
+
+#include "ui/events/event.h"
+#include "ui/events/ozone/events_ozone.h"
+#include "ui/events/x/events_x_utils.h"
+#include "ui/gfx/geometry/point.h"
+
+namespace ui {
+
+void X11Window::SetCursor(PlatformCursor cursor) {}
+
+void X11Window::ProcessXInput2Event(XEvent* xev) {
+ NOTREACHED();
+}
+
+bool X11Window::CanDispatchEvent(const PlatformEvent& event) {
+ return true;
+}
+
+uint32_t X11Window::DispatchEvent(const PlatformEvent& platform_event) {
+ Event* event = static_cast<Event*>(platform_event);
+ DispatchEventFromNativeUiEvent(
+ event, base::Bind(&PlatformWindowDelegate::DispatchEvent,
+ base::Unretained(delegate_)));
+
+ return POST_DISPATCH_STOP_PROPAGATION;
+}
+
+bool X11Window::DispatchXEvent(const XEvent& xev) {
+ if (XWindowFromXEvent(xev) != xwindow_)
+ return false;
+
+ ProcessXWindowEvent(xev);
+ return true;
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698