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

Unified Diff: views/mouse_watcher.cc

Issue 7464027: Wayland support for views. views_desktop on Wayland. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated native_widget_wayland.cc to match compositor changes Created 9 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 | « views/metrics_wayland.cc ('k') | views/native_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/mouse_watcher.cc
diff --git a/views/mouse_watcher.cc b/views/mouse_watcher.cc
index 810db692326bfa2947d44fbb0ccf4819f8b5e80b..83fe75d2f3ab32be141b1ec008b1db5928e50fb9 100644
--- a/views/mouse_watcher.cc
+++ b/views/mouse_watcher.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -11,6 +11,10 @@
#include "views/view.h"
#include "views/widget/widget.h"
+#if defined(USE_WAYLAND)
+#include "ui/wayland/events/wayland_event.h"
+#endif
+
namespace views {
// Amount of time between when the mouse moves outside the view's zone and when
@@ -56,6 +60,22 @@ class MouseWatcher::Observer : public MessageLoopForUI::Observer {
break;
}
}
+#elif defined(USE_WAYLAND)
+ MessageLoopForUI::Observer::EventStatus WillProcessEvent(
+ ui::WaylandEvent* event) {
+ switch (event->type) {
+ case ui::WAYLAND_MOTION:
+ HandleGlobalMouseMoveEvent(false);
+ break;
+ case ui::WAYLAND_POINTER_FOCUS:
+ if (!event->pointer_focus.state)
+ HandleGlobalMouseMoveEvent(true);
+ break;
+ default:
+ break;
+ }
+ return EVENT_CONTINUE;
+ }
#else
void WillProcessEvent(GdkEvent* event) {
}
« no previous file with comments | « views/metrics_wayland.cc ('k') | views/native_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698